首页 > 编程语言 > 详细

spring 配置文件 引入外部的property文件的两种方法

时间:2016-09-22 16:57:00      阅读:266      评论:0      收藏:0      [点我收藏+]

spring  的配置文件

引入外部的property文件的两种方法

<!-- 引入jdbc配置文件    方法一 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<!--要是有多个配置文件,只需在这里继续添加即可 -->
<value>classpath:properties/*.properties</value>
</list>
</property>
</bean>

 

<!-- 引入jdbc配置文件    方法二 -->

<context:property-placeholder location="classpath:jdbc.properties" />

 

spring 配置文件 引入外部的property文件的两种方法

原文:http://www.cnblogs.com/qypx520/p/5897039.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!