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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to