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.
You can write a another Java class and make it as a bean in Application context and using Spring Expression Language, you have evaluate and get output of the method call.
XML configuration:
WeServiceInfoFromDB.java class:
class WebServiceInfoFromDB {
public String getWsdlUrl() {
// Get the Wsdl URL from DB.
return wsdlUrl;
}
public String getUsername(){
// get the username from DB
return username;
}
XML configuration in application context: