You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Colin Brumelle <cb...@home.com> on 2001/06/30 00:42:02 UTC

Specifying the root of your app???

Hi All,

My Problem:

     When I need to read or write something to disk, I always have trouble
finding out where the root of my application is... For example, If my
application is in "webapps", Tomcat treats the "bin" directory as the root
(because thats where its running). How do you specify a different directory
as the "root" of your application? Or is there some other way to refer to
the directory where the jsp is run from? (Through the servlet context???)
Ideally, I just want to be able to say "look one directory up from wherever
this jsp is run from, and open file "blah.xml" or something...

Thanks a bunch...

Colin Brumelle



RE: Specifying the root of your app???

Posted by Filip Hanik <ma...@filip.net>.
getPathTranslated() and getPathInfo() from the HttpServletRequest object
should give you the info you need

Filip
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
filip@filip.net
www.filip.net

>-----Original Message-----
>From: Colin Brumelle [mailto:cbrumelle@home.com]
>Sent: Friday, June 29, 2001 3:42 PM
>To: tomcat-user@jakarta.apache.org
>Subject: Specifying the root of your app???
>
>
>Hi All,
>
>My Problem:
>
>     When I need to read or write something to disk, I always have trouble
>finding out where the root of my application is... For example, If my
>application is in "webapps", Tomcat treats the "bin" directory as the root
>(because thats where its running). How do you specify a different directory
>as the "root" of your application? Or is there some other way to refer to
>the directory where the jsp is run from? (Through the servlet context???)
>Ideally, I just want to be able to say "look one directory up from wherever
>this jsp is run from, and open file "blah.xml" or something...
>
>Thanks a bunch...
>
>Colin Brumelle
>
>
>