I think getServletContext().getRealPath() can do it
----- Original Message -----
From: "Stefan Freyr Stefansson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 09, 2000 2:56 PM
Subject: how to get the absolute path to a webapp
> Hello.
>
> I'm working with Tomcat 3.2 and I would like to know how to get the
absolute
> path to the root of the webapp I'm in...
>
> Like if I wanted to keep a file in a 'conf' directory or even 'WEB-INF'
> directory of the web app... how could I access that through a JSP? Is
there
> any method to call to get the absolute path of the web-app so I could say
> for example:
> accessFile(something.getAbsolutePath() + "\WEB-INF\file.dem");
>
> Any help would be greatly appreciated.
>
> Kind regards,
> Stefan
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets