property-placeholder location from another property

后端 未结 2 1443
灰色年华
灰色年华 2020-12-01 06:10

I need to load some properties into a Spring context from a location that I don\'t know until the program runs.

So I thought that if I had a PropertyPlaceholderConf

2条回答
  •  孤街浪徒
    2020-12-01 06:43

    You can do this with a slightly different approach. Here is how we configure it. I load default properties and then overrided them with properties from a configurable location. This works very well for me.

    
            
            
                
                    classpath:site/properties/default/placeholder.properties
                    
                    classpath:site/properties/${env.name}/placeholder.properties
                    
                
            
        
    

提交回复
热议问题