在Spring中引入多个properties的最简单的方法:
通过context:property-placeholder加载配置文件properties中的内容
<context:property-placeholder location="classpath:*.properties" ignore-unresolvable="true"/>
但是如果Java程序打包成为jar的话,这样使用* 则是不行的,会找不到properties文件而出现错误,这时就需要下面这种方式了
<context:property-placeholder location="classpath*:jdbc.properties,classpath*:init.properties,classpath:test.properties" ignore-unresolvable="true"/>
前面几个properties都在classpath后面加上*,各个properties间用逗号隔开,最后一个则不需要