You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Danny Angus <da...@apache.org> on 2002/07/11 15:22:09 UTC

StandardContext .. getPath()

Hi,

I can't find the answer to this question anywhere, although I expect its
quite simple..

I've created my own context class, subclassing StandardContext, and I want
it to be able to read a config file, but I'm having problems getting a path
from tc.

How can I get the real path to ~/webapps, or get CATALINA_HOME for my
context to use in its hunt for its config file?

I realise I may have missed the blindingly obvious here, for which I
appologise in advance.

d.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: StandardContext .. getPath()

Posted by Danny Angus <da...@apache.org>.
I'll answer my own question..
getServletContext() returns null until start() (or in my case super.start())
has been called, whereafter I can use ServletContext.getRealPath()

d.

> -----Original Message-----
> From: Danny Angus [mailto:danny@apache.org]
> Sent: 11 July 2002 14:22
> To: Tomcat-Dev@Jakarta. Apache. Org
> Subject: StandardContext .. getPath()
>
>
> Hi,
>
> I can't find the answer to this question anywhere, although I expect its
> quite simple..
>
> I've created my own context class, subclassing StandardContext, and I want
> it to be able to read a config file, but I'm having problems
> getting a path
> from tc.
>
> How can I get the real path to ~/webapps, or get CATALINA_HOME for my
> context to use in its hunt for its config file?
>
> I realise I may have missed the blindingly obvious here, for which I
> appologise in advance.
>
> d.
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>