There are a number of ways for a webapp to access properties.
- A file under the web application root using ServletContext.getResource(AsStream)(). The problem with this is obviously that the file is inside the .war file.
- Through the class path using Class.getResource(AsStream)(). Here you can access files outside the .war file. But there is a problem finding out what file to actually load in a particular webapp. At least if you use the init() method of a servlet. If you deploy several instances of the same webapp the thing that will be different is the context path that they are deployed under. And this information is only available in the HttpServletRequest object, not in the ServletContext.
- Through system properties. This has the same problems as using the classpath and it may also not always be possible to set system properties parameters when starting the jvm.
I have installed a number of web application where I have had to find a property file deep inside the application server's deployment directories and edit it. Is there really no better way?