Chinaunix首页 | 论坛 | 博客
  • 博客访问: 634362
  • 博文数量: 17
  • 博客积分: 248
  • 博客等级: 二等列兵
  • 技术积分: 237
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-26 12:13
个人简介

别让往昔的悲伤和对未来的恐惧,毁了你当下的幸福。

文章分类

全部博文(17)

文章存档

2013年(6)

2012年(2)

2011年(9)

我的朋友

分类: Java

2011-08-29 22:33:14

1.在配置文件中配置PropertyPlaceholderConfigurer
  1. <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  2.   <property name="locations" value="classpath:com/foo/jdbc.properties"/>
  3. </bean>
 
然后在需要的地方直接以下方式引用:
  1. <property name="url" value="${jdbc.url}"/>
 
2.在配置文件中加入
beans的命名空间声明如下:
  1. <beans xmlns=""
  2.      xmlns:xsi="" xmlns:context=""
  3.      xmlns:aop="" xmlns:tx=""
  4.      xsi:schemaLocation="
  5.             /spring-beans-3.0.xsd
  6.             
  7.             /spring-context-3.0.xsd
  8.             
  9.             /spring-aop-3.0.xsd
  10.             
  11.             /spring-tx-3.0.xsd">
 
 
用到了
  1. xmlns:context=
配置如下:
  1. <context:property-placeholder location="dbconf.properties"/>
 

 
阅读(14537) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:mybatis学习总结

给主人留下些什么吧!~~