.properties配置文件中配置xxx=yyy,在ApplicationContext*.xml文件中通过${xxx}得到yyy:
关于PropertyPlaceholderConfigurer:
[url]http://wangyu.iteye.com/blog/314835[/url]
结合使用PropertyPlaceholderConfigurer 和 org.apache.commons.configuration.XMLConfiguration:
[url]http://stackoverflow.com/questions/3163838/propertyplaceholderconfigurer-reads-from-xml-file-apache-commons-configuration[/url]
<!-- 属性文件读入 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:conf/jdbc.properties</value>
<value>classpath*:conf/mail.properties</value>
<value>classpath*:conf/pagermodel.properties</value>
<value>classpath*:conf/dataSync.properties</value>
</list>
</property>
</bean>
关于PropertyPlaceholderConfigurer:
[url]http://wangyu.iteye.com/blog/314835[/url]
结合使用PropertyPlaceholderConfigurer 和 org.apache.commons.configuration.XMLConfiguration:
[url]http://stackoverflow.com/questions/3163838/propertyplaceholderconfigurer-reads-from-xml-file-apache-commons-configuration[/url]