spring载入外部配置文件的方法

<bean class=“org.springframework.beans.factory.config.PropertyPlaceholderConfigurer“>
       <property name=“locations“>
              <value>classpath:xxx.properties</value>
       </property>
</bean>

或者

<context:Property-Placeholderlocation=”classpath:xxx.properties”/>

接下来就可以在Bean或者XML用{xxx}的方式调用了

posted @ 2015-11-12 09:49  东苑草根  阅读(199)  评论(0编辑  收藏  举报
手牵手 一步两步三步 往上爬