Accessing multiple property files with @PropertyResource in Spring

后端 未结 3 1535
盖世英雄少女心
盖世英雄少女心 2020-12-08 15:17

Using the new @PropertySource annotation in Spring 3.1, how can you access multiple property files with Environment?

Currently I have:

@         


        
3条回答
  •  甜味超标
    2020-12-08 16:13

    If you can migrate to Spring 4.x the problem has been solved with the new @PropertySources annotation:

    @PropertySources({
            @PropertySource("/file1.properties"),
            @PropertySource("/file2.properties")
    })
    

提交回复
热议问题