Relative paths - using config files through a servlet
843841Feb 18 2008 — edited Feb 19 2008I am currently running a package of servlets on a Tomcat server in Eclipse, and have recently started using a config file for the database connection strings. Unfortunately, pathnames are relative to my Eclipse installation, which is somewhere completely different from the project or indeed the location of the server's web root. It will also be somewhere different once the project is deployed as a WAR file on the production server.
I thought I could place my config file into the WebContent directory of the project along with the jsp pages (securing it from public view, of course). But that looks to be difficult. Can anyone suggest a good location for my configuration text file to be, and how to access this location from inside my servlet? It should be possible to modify the configuration text file on the live server without having to re-deploy the WAR file...