我有一些特性在我的Tomcat context.xml文件设置如下PropertyPlaceHolderConfigurer不读Tomcat相关XML
<Parameter name="foobar" value="something" />
我使用的符号$ {} foobar的读取这些值代入我的春天XML。这工作得很好,当我使用的背景:财产占位符标记,但是当我直接定义这个代替作为提供一个PropertyPlaceholderConfigurer豆,我得到以下错误:
Could not resolve placeholder 'foobar' in string value "${foobar}"
旧(工作):
<context:property-placeholder location="/WEB-INF/classes/*.properties" />
新(不工作):
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/classes/app.properties</value>
<value>/WEB-INF/classes/security.properties</value>
</list>
</property>
</bean>
看起来不错,以me..Please发布详细的异常。此外,尝试清理你的tomcat和你的项目只是为了确保更新已被正确采用 –