Spring中引入properties文件
2015-06-09 21:53
381 查看
方法1:
<context:property-placeholder location="classpath:com/dispatch/db.properties"/>
方法2:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:com/dispatch/db.properties</value>
</list>
</property>
</bean>
<context:property-placeholder location="classpath:com/dispatch/db.properties"/>
方法2:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:com/dispatch/db.properties</value>
</list>
</property>
</bean>
相关文章推荐
- Java虚拟机ClassLoader知识详解(2)
- Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file
- Struts2学习笔记(1)——Struts2的基本介绍
- OSGI学习之路-苦咲
- Ubuntu下用Myeclipse创建Java Web项目
- java之静态代码块、构造块、构造方法的简单例子
- 解决MyEclipse当确认所有配置都配好后还是无法达到目的的问题
- java设计模式 ----工厂模式
- java的四大特征
- Java线程
- easyUi的combotree绑定后台返回的json字符串(EasyUI+spring mvc+mybatis)
- Servlet3.0在文件上传时遇到的错误及解决方法
- Java for LeetCode 219 Contains Duplicate II
- Java for LeetCode 218 The Skyline Problem【HARD】
- Java for LeetCode 217 Contains Duplicate
- java mail 做邮件 错误javax/mail/MessagingException
- Java for LeetCode 216 Combination Sum III
- 使用Fragment时出现 java.lang.IllegalStateException: Fragment already active
- 一些java的基础知识
- Java for LeetCode 215 Kth Largest Element in an Array