tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
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 
advantage/disadvantage:
- 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()

-Tim

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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message