您的位置:首页 > 编程语言 > Java开发

Spring配置中从外部文件加载多个properties文件

2017-12-07 14:55 507 查看
方式一:

<context:property-placeholder location="classpath:resources/jdbc.properties,classpath:/resources/redis.properties"/>
方式二:

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/resources/jdbc.properties</value>
<value>classpath:/resources/redis.properties</value>
</list>
</property>
</bean>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: