这个其实也算是个小问题,就是拿来记录一下。
原文地址:/u012198209/article/details/88965922
一般来说报Could not resolve placeholder ‘xxx’ in string value “${xxx}” 错误的原因都是由于项目中有多个地方的xml文件中用到了 <context:property-placeholder location=“classpath:xxx.properties”/> 或者是 来引入配置文件,这时需要在这两条配置后分别加上
ignore-unresolvable="true"
和
p:ignoreUnresolvablePlaceholders="true"
来防止程序不能识别配置属性。 也就是
<context:property-placeholder location="classpath:xxx.properties" ignore-unresolvable="true"/>
和
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:ignoreUnresolvablePlaceholders="true">
这样应该就行了