tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øyvind Hvamstad <oyv...@hvamstad.net>
Subject Relative paths in servlets?
Date Mon, 06 Jan 2003 13:35:50 GMT
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-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message