I have Java function:
public String getEnvironment(){
String env = System.getProperty("tomcat.runtime.environment.version");
if(env == null)
return "DEV";
return env;
}
and it is usually called this way:
string devEmail = configuration.getString(getEnvironment() + ".DEVELOPER_EMAIL");
Basically, getEnvironment will return strings (depending of environment) DEV, TEST or PROD and it will read from some configuration object proper information for current environment.
The part I don’t understand is how is this set? How production server knows to return PROD, developemnt DEV, or test server to return TEST? Or, how do I set property “tomcat.runtime.environment.version” on the web server?
It’s Apache Tomcat 6.0 web server.
you need to add it to catalina.sh on linux or catalina.bat on windows.