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

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" />

 

posted @ 2016-09-22 16:50  爱分享社区  阅读(2402)  评论(0编辑  收藏  举报