I guess I should have phrased my question differently.
I do not know what directory path to use in order to point to the "web" or "qeb/resources" directories.
I will have somethng like:
String path = configDir+"configFIle.cfg"
What I don't know is what to use for configDir.
configDir = ? in order to point to the project 'web' or 'web/resources'
directories.
I did a little searching to find out how to use ServletContext.getRealPath and what I found is that you can't use this with a .war file since the paths are not expanded.
What I need to do is read the config file from within the war file.
There was some mention of using ServletContext.getResource(), but I'm clueless how to use that.
Ah OK, now I see .. You can use a propertiesfile and put it in the classpath (inside a WAR, it can be the root of the package or the WEB-INF/lib directory). Then you can retrieve it by ClassLoader#getSystemResourceAsStream().
Basically:
String filename = "config.properties";
InputStream input = ClassLoader.getSystemResourceAsStream(filename);
Properties properties = new Properties();
properties.load(input);
input.close();
String someKey = properties.getProperty("someKey");
Where config.properties looks like:someKey = someValue
anotherKey = anotherValue
Also see the [url=http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html]java.util.Properties[/url] API.