how to pass values dynamically in config file

后端 未结 2 1234
夕颜
夕颜 2020-12-20 10:17

I want to pass the value in the value tag of the property dynamically from the DB. Is this possible in Spring? And how ?

For example in the configuration below.

2条回答
  •  情歌与酒
    2020-12-20 10:47

    You can setup property Place Holder with your properties file name that contains key-value pair.

    The config.properties file looks like:

    wsdl.url = http://server:8080/ServiceAccessPoint
    webservice.username = guest
    webservice.passward = guest123
    

    Now you can modify your bean definition with ${key}

    
    
    
    
    
    

提交回复
热议问题