`

propertyConfigurer spring 引入多个属性文件

阅读更多
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
  <property name="locations">
   <list>
    <value>config2.properties</value>
    <value>config1.properties</value>
   </list>
  </property>
</bean>


注意如果有同名属性  后边的配置文件会覆盖前边的配置文件

如上例 config1.properties 里的属性 如果和config2.properties 里的属性重名 我们得到值是config1.properties 里面的
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics