在下面的代码片段中
<bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
depends-on="environment">
<property name="location" value="classpath:batch-${ENVIRONMENT}.properties" />
“依赖”的意义是什么以及如何操纵 ${ENVIRONMENT} 的值??
系统的环境变量中的Environment是指我的系统变量吗?
最佳答案
检查 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
在您的情况下,id 为 environment
的 bean 必须在“placeholderProperties”之前初始化
关于java - PropertyPlaceholderConfigurer 和依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6095803/