Java 未从服务器环境中选取属性值的spring配置文件存在问题?
我已经将spring.profiles.active环境变量配置到WebSphereServer中,并将变量值配置到spring配置文件中。 我的Config.xml类似于Java 未从服务器环境中选取属性值的spring配置文件存在问题?,java,spring,spring-mvc,spring-profiles,Java,Spring,Spring Mvc,Spring Profiles,我已经将spring.profiles.active环境变量配置到WebSphereServer中,并将变量值配置到spring配置文件中。 我的Config.xml类似于 <bean id="propertiesUtil" class="common.PropertiesUtil"> <property name="locations"> <list> <value>classpath:common
<bean id="propertiesUtil" class="common.PropertiesUtil">
<property name="locations">
<list>
<value>classpath:common.properties</value>
<value>classpath:${spring.profiles.active}/env_${spring.profiles.active}_config.properties</value>
</list>
</property>
如果我错过了什么,请告诉我?谢谢,
它正在工作,我已经从WAS环境中获取了spring.profiles.active变量的值并存储到上下文范围中。您确实有一个
否,我只在beanThen中配置了占位符无法工作。您需要添加占位符配置才能替换占位符。如何以及在何处添加占位符您可以给出示例吗?请阅读我的初始评论。。。
Caused by: java.io.FileNotFoundException: class path resource
[${spring.profiles.active}/env_${spring.profiles.active}_config.properties]
cannot be opened because it does not exist