Hi,
Did you try getServletContext().getResourceAsStream("/foo.html"); ?

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Øyvind Hvamstad [mailto:[EMAIL PROTECTED]]
>Sent: Monday, January 06, 2003 8:36 AM
>To: [EMAIL PROTECTED]
>Subject: Relative paths in servlets?
>
>Hi, could anyone tell me how to access files using relative paths from a
>servlet? Say, if servlet is mapped to /bar and the file foo.html is in
>the webapps top dir. How do I access the foo.html file from the servlet.
>I tried ../foo.html, /foo.html and even
>getServletContext().getRealPath(/bar)+"/../foo.html" but none works.
>
>Any pointers?
>--
>Øyvind Hvamstad
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:tomcat-user-
>[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to