In many cases, I would use Class.getResource to load properties files in preference to the ServletContext one, as that way it works exactly like a normal application, you can package your properties in a jar, etc.
The CLASSPATH method of overriding properties won't work in a web-app context, as the classloader generally prefers classes in the web-app WAR over those in the CLASSPATH (SRV.9.7.2).
But all is not lost. The Servlet specification mandates that WEB-INF/classes comes
before the jars in WEB-INF/lib in the classloader chain (SRV.9.5). As a consequence, if there is a default .properties file hiding inside a jar in WEB-INF/lib, you can override it simply by putting a .properties in the equivalent location in WEB-INF/classes. You shouldn't even have to fiddle your CLASSPATH.
A
word of warning, although this works for me, this seems to me one of those areas where servers may subtly deviate from the spec.
- Peter
[ May 09, 2002: Message edited by: Peter den Haan ]