我们在spring的xml配置中都会有指定properties文件的时候,归纳下,有如下几种情况L:
1、<context:property-placeholder location="classpath:xxx.properties" ignore-unresolvable="true"/>
2、<context:property-placeholder location="classpath:*.properties" ignore-unresolvable="true"/>
3、<context:property-placeholder location="classpath*:yyy.properties" ignore-unresolvable="true"/>
4、<context:property-placeholder location="classpath*:*.properties" ignore-unresolvable="true"/>
其中,情况1表示只加载当前classpath下的xxx.properties;情况2表示加载当前classpath下的所有properties文件;
情况3表示加载包含lib中所有jar包以及本classpath下的所有yyy.properties;情况4以此类推