使用PropertyPlaceholderConfigurer类读取外部属性文件内容到XML
来源:互联网 发布:linux shell % 编辑:程序博客网 时间:2024/06/16 22:44
PropertyPlaceholderConfigurer将属性文件中的信息加载到XML配置文件中
<!-- 属性文件读入 --><bean id="propertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath*:config/jdbc.properties</value></list></property></bean><!-- 数据源定义,使用Apache DBCP 连接池 --><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"><property name="driverClassName" value="${jdbc.driverClassName}"/><property name="url" value="${jdbc.url}"/><property name="username" value="${jdbc.username}"/><property name="password" value="${jdbc.password}"/></bean>
jdbc.properties文件:
jdbc.url=jdbc\:mysql\://127.0.0.1\:3306/eop?useUnicode\=true&characterEncoding\=utf8jdbc.username=rootjdbc.password=rootjdbc.driverClassName=com.mysql.jdbc.Driver
tomcat启动时,配置文件中的信息就加载到XML中了。
0 0
- 使用PropertyPlaceholderConfigurer类读取外部属性文件内容到XML
- 使用PropertyPlaceholderConfigurer读取.properties文件(3)-公共类获取属性
- spring中使用外部属性文件(关于PropertyPlaceholderConfigurer)
- Spring —— web.xml 中用 PropertyPlaceholderConfigurer 类读取properties 文件 或 属性
- 使用PropertyPlaceholderConfigurer读取.properties文件(2)-处理加密属性
- 用java.util.Properties类读取属性文件的内容,或者把属性写到xml文件中
- spring里PropertyPlaceholderConfigurer读取属性文件
- 读取xml文件中的内容到HashTable
- 读取xml文件内容到数据库
- 使用PropertyPlaceholderConfigurer读取.properties文件(1)
- 使用PropertyPlaceholderConfigurer类载入外部配置
- 使用PropertyPlaceholderConfigurer类载入外部配置
- Android使用SAX读取XML文件内容
- 读取xml文件内容
- 读取XML文件内容
- spring中PropertyPlaceholderConfigurer的使用,引入外部资源文件
- 使用PropertyPlaceholderConfigurer读取配置文件
- PropertyPlaceholderConfigurer XML中的一些配置数据存在属性文件中
- Jquery中的验证jquery.validate.js
- 【centos7】安装redis
- ios之transform
- java中读取文件总结
- Android Activity window(7.1)解析(一)
- 使用PropertyPlaceholderConfigurer类读取外部属性文件内容到XML
- 设计模式-观察者模式
- JdbcTemplate/ SimpleJdbcTemplate
- 读取一个SQL文件 + 批量执行batchUpdate(String[ ])
- Oracle自动性能统计
- 数据库学习
- android自定义控件画布canvas背景色失效变黑色
- 表中父子关系
- 解决:angular.js中插值表达式为HTML时需要被渲染的问题