I have a bunch of properties (configurations) that can change per environment. However these values do not change once the web application is deployed.So consider that there
You should have a static reference to these properties, and access them that way. You will end up reading them into memory once, and keeping them there. That way, you won't have to access the disk so many times at runtime.
So, suppose you have a class AppProperties:
public class AppProperties {
private static Properties props;
protected static loadProperties(File propsFile) {
... read from disk, and set props static member ...
}
public static getProperties() {
return props;
}
}
From your initializer servlet, you would call loadProperties to read the properties from disk. Then, in your application code, to access the properties:
String myProp = AppProperties.getProperties().getProperty("myProp");