spring加载配置属性文件(properties)

时间:2014-09-25 12:11:10   收藏:0   阅读:380

两种方法:


-----------------------------------1----------------------------

<!-- 加载链接数据库属性文件 -->
<context:property-placeholder location="classpath:dataSource-configer.properties" />



-----------------------------------2----------------------------

<bean id="joinCDB" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:jdbc.properties</value>
</property>
</bean>



(实例参考上面spring配置)

本文出自 “东方小阁” 博客,请务必保留此出处http://lailai.blog.51cto.com/3362373/1558004

原文:http://lailai.blog.51cto.com/3362373/1558004

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!