tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: directory reference
Date Sat, 29 Nov 2003 00:11:55 GMT
The best way is to use ServletContext.getResourceAsStream() to load a file 
from your webapp.  This is portable (and safest) to any servlet container.

-Tim

Giorgio Franceschetti wrote:

> Hi all,
>   I'd like to create a file with some configuration details for my 
> application.
> I tryed to reference my file like this "./data.txt" and I found it in my 
> tomcat/bin directory.
> Well, I should  have expected this, quite like any other java 
> application points to the executable directory.
> Is there any way to point to my application directory?
> Should I assume a fixed path like tomcat/webapps/myapp    ?
> Thanks in advance,
>    Giorgio 


---------------------------------------------------------------------
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