注解形式读取properties文件中的属性

1、spring.xml中加入(多个properties 用逗号隔开)  <context:property-placeholder location="classpath:jdbc.properties,classpath:config.properties" />

2、spring-mvc.xml 中加入(只加上面一句controller中读取不到值) <context:property-placeholder location="classpath:config.properties" />

 

posted @ 2017-12-02 11:09  咸蛋超人、  阅读(736)  评论(0编辑  收藏  举报