tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: File location - read/written by servlets
Date Thu, 13 Nov 2003 11:51:13 GMT
When opening files for writing you need to use absolute paths. Because at any 
given time, any servlet, jsp can change the working directory which affects 
the entire JVM. As to getting a directory to write to, use a configuration 
parameter in any of the following ways, each way having its own 
- Use a system property at startup
- Use a JNDI Property resource defined in server.xml
- Use a configuration parameter in web.xml
- Use a properties file at a "well known location" which can be found in a 
webapp via ServletContext.getResourceAsStream()


K. Harvatis wrote:
> Hi all,
> I am trying hard to find some setting or configuration regarding the
> location of files used by servlets. So far I can see that the default
> directory is \bin. Is there a way to set this directory elsewhere?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message