I load a properties file in spring :
<context:property-placeholder location="classpath:foo.properties"/>
But if I try to load another file in a different context file I get error.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you need to override properties you can do:
OR
if the error is due to not finding a certain property, you can set
ignoreUnresolvablePlaceholdersto true.OR
if the error is about not found resource ( and you’re ok with it ), you can set
ignoreResourceNotFoundto true.OR
if there are errors in finding system properties:
The PropertyPlaceholderConfigurer not only looks for properties in the Properties file you specify. By default it also checks against the Java System properties if it cannot find a property in the specified properties files. You can customize this behavior by setting the
systemPropertiesModeproperty of the configurer with one of the following three supported integer values:never (0): Never check system properties
fallback (1): Check system properties if not resolvable in the specified properties files. This is the default.
override (2): Check system properties first, before trying the specified properties files. This allows system properties to override any other property source.