I have one utility class where i have one method which requires username and password to connect other url. I need to kept that username in properties file so that i can change
In you Utility
class you can have a setter method to set the properties and then you can use MethdInvokingFactoryBean
.
class Utility{
static String username;
static String password;
public static setUserNameAndPassword(String username, String password){
Utility.username = username;
Utility.password = password;
}
//other stuff
}
classpath*:/myservice_detaults.properties
classpath*:/log4j.properties
${username}
${password}