1. 程式人生 > >註解形式讀取properties文件中的屬性

註解形式讀取properties文件中的屬性

ati ssp location fig ext class per ring control

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" />

註解形式讀取properties文件中的屬性