Spring Util:Properties Injection via Annotations into a bean

前端 未结 5 816
轻奢々
轻奢々 2020-12-23 21:19

If I have 2 .properties files setup in my Spring XML as so:



        
5条回答
  •  别那么骄傲
    2020-12-23 21:49

    You can use @PropertySource

    @Configuration
    @PropertySource(name = "someName", value = {"classpath:a.properties", "classpath:b.properties"})
    public class MyConfiguration {
    }
    

提交回复
热议问题