0

I run a Spring-Boot application (v2.7) via Eclipse Run configuration. In the Program arguments section, I pass the parameter

--server.jsp-servlet.init-parameters.development=true

But this doesn't seem to have any effect. When running the application, pageContext.getServletConfig().getInitParameter("development") returns false.

There is no other location where the init-parameters property is set.

What am I missing?

EDIT: when I set the parameter in (already existing) application.yaml it works.

server:
  servlet:
    jsp:
      init-parameters:
        development: true

But I need to set it via command line ...

Abid
  • 565
  • 1
  • 5
  • 15
  • 1
    The property name on the command line doesn't match the property name in your YAML file. To match, it should be `--server.servlet.jsp.init-parameters.development` – Andy Wilkinson Jun 16 '22 at 09:43

1 Answers1

0

It was a typo. The correct argument is:

--server.servlet.jsp.init-parameters.development=true

This works as expected.

I copied the wrong value from https://stackoverflow.com/a/60074764/9826710 ...

Abid
  • 565
  • 1
  • 5
  • 15