tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McLawhorn" <mmclawhorn_w...@hotmail.com>
Subject Re: File access from a servlet.
Date Tue, 17 Dec 2002 18:46:00 GMT
Servlets have different security restrictions on which files they can touch 
and interact with.



>From: Patrick Martz <PMartz@teltone.com>
>Reply-To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>To: "'tomcat-user@jakarta.apache.org'" <tomcat-user@jakarta.apache.org>
>Subject: File access from a servlet.
>Date: Tue, 17 Dec 2002 10:42:00 -0800
>
>Hi all.
>
>I'm currently working on a java servlet with tomcat and I want it to be 
>able
>to load a different data file dependent on certain parameters passed to the
>servlet. The problem is that if I just try to open the file with the file
>name (i.e. FileInputStream fin = new FileInputStream("blah.dta");) it fails
>to find the file. I am guessing this is because the runtime directory is
>different from the directory the servlet is running in? (the data file and
>the servlet are in the same directory, but the servlet fails to find the
>file still). So my question is, is there a way to get the current runtime
>directory for Tomcat so that I can perhaps supply a relative path to get to
>the file and have the servlet be able to open it? Thanks!
>
>Patrick
>
>P.S. For debugging purposes I HAVE tested opening of the file from a stub
>class and it works just fine that way, but fails from the servlet.
>
>--
>To unsubscribe, e-mail:   
><mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:tomcat-user-help@jakarta.apache.org>


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message