Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Relative paths - using config files through a servlet

843841Feb 18 2008 — edited Feb 19 2008
I 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...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2008
Added on Feb 18 2008
2 comments
705 views