Spring中 @PropertySources注解中放入两个文件 怎么去一个一个读取并注入到自己创的properties对象中呢


@PropertySources({@PropertySource("db.properties"),@PropertySource("db1.properties")}) 

读取单个的我会 这个里面是个PropertySource数组,怎么读取 db.properties 以及 db1.properties 并分别注入到两个properties对象中

多看看源码就知道了

读取多个配置文件:
@PropertySource(value = {"classpath:spring/config.properties","classpath:spring/news.properties"})