施用PropertyPlaceholderConfigurer类读取外部属性文件内容到XML

使用PropertyPlaceholderConfigurer类读取外部属性文件内容到XMLPropertyPlaceholderConfigurer将属性文件

使用PropertyPlaceholderConfigurer类读取外部属性文件内容到XML

PropertyPlaceholderConfigurer将属性文件中的信息加载到XML配置文件中

?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中了。