Chinaunix首页 | 论坛 | 博客
  • 博客访问: 838842
  • 博文数量: 182
  • 博客积分: 1992
  • 博客等级: 上尉
  • 技术积分: 1766
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-18 11:49
文章分类

全部博文(182)

文章存档

2019年(1)

2016年(5)

2015年(29)

2014年(38)

2013年(21)

2012年(36)

2011年(52)

我的朋友

分类: Java

2015-07-30 10:52:36

(1)获取一个配置文件 

点击(此处)折叠或打开

  1. <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
  2.   <property name="location"> 
  3.     <value>file:db.properties</value> 
  4.   </property> 
  5. </bean>

(2)获取多个配置文件时,配置就需要使用locations

点击(此处)折叠或打开

  1. <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
  2.     <property name="locations"> 
  3.         <value>classpath:/resources/jdbc.properties</value>
  4.         <value>classpath:/resources/system.properties</value> 
  5.     </property> 
  6. </bean>

阅读(558) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~