Spring使用多个 <context:property-placeholder/>

Spring中报"Could not resolve placeholder"的解决方案(引入多个properties文件)

 

解决方案:

  (1) 在Spring 3.0中,可以写:

Xml代码  
<context:property-placeholder location="xxx.properties" ignore-unresolvable="true"  
/>  
<context:property-placeholder location="yyy.properties" ignore-unresolvable="true"  
/>  

 

注意两个都要加上ignore-unresolvable="true",一个加另一个不加也是不行的

posted @ 2019-11-26 10:34  GordonDicaprio  阅读(357)  评论(0编辑  收藏  举报