1、读取单个文件
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:jdbc.properties"/> </bean>
2、读取多个文件 (推荐)
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:jdbc.properties</value> <value>file:jdbc.properties2</value> </list> </property> </bean>
3、整合多个placeHolder
http://www.cnblogs.com/davidwang456/p/3891460.html
本文介绍了如何在Spring中利用placeHolder读取文件内容并注入为配置参数,包括读取单个文件的方法、读取多个文件的推荐实践以及整合多个placeHolder的技巧。
167万+

被折叠的 条评论
为什么被折叠?



