美文网首页
spring xml引入多个配置文件

spring xml引入多个配置文件

作者: 李中凯_f395 | 来源:发表于2020-01-17 09:46 被阅读0次

spring的xml中引入单个配置文件

<context:property-placeholder location="classpath:release/jdbc.properties" />

spring的xml中引入多个配置文件(需要加ignore-unresolvable="true")

//模糊匹配
<context:property-placeholder location="classpath:release/*.properties" ignore-unresolvable="true"/>
//精准匹配
<context:property-placeholder location="classpath:release/jdbc.properties,classpath:release/config.properties,classpath:release/ireport.properties" ignore-unresolvable="true"/>

需要注意的是context:property-placeholder标签只能出现一次,所以如果在xml中配置多个context:property-placeholder,spring默认只识别第一个

相关文章

网友评论

      本文标题:spring xml引入多个配置文件

      本文链接:https://www.haomeiwen.com/subject/qlhczctx.html