Question

How to set default boolean values with ServletContextPropertyPlaceholderConfigurer? For example, I want property to have false value if it is not set as <context-param>

Was it helpful?

Solution

you can always define a default value for every place where the property configurere "inject" some value.

The default synax is ${propertyName:default}

So for example:

${myContextParam:false}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top