PropertyPlaceholderConfigurer and depends-on
In the below code snippet
<bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
depends-on="e开发者_如何学Cnvironment">
<property name="location" value="classpath:batch-${ENVIRONMENT}.properties" />
what is the significance of "depends-on" and how to manipulate the value of ${ENVIRONMENT} ??
is the Environment referring to my system variable in the environment variables of the system?
Check this
depends-on
: The depends-on attribute can explicitly force one or more beans to be initialized before the bean using this element is initialized
In your case bean with id environment
must get initialized before "placeholderProperties"
精彩评论