You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sean Leblanc <Se...@insightamerica.com> on 2004/01/07 17:40:16 UTC

Discovering the webapp path.

I'm hoping this isn't a FAQ somewhere. I did try googling and searching the
mailing list. Here goes:

Is there a way to, at runtime, discover the path that the webapp is in? I
can't really rely on the root path being any particular path and doing
absolute path, because depending on how tomcat is started, root is in
different places.


TIA,

--
Sean LeBlanc
Software Developer
insightamerica
"Those who do not understand Unix are condemned to reinvent it, poorly."
--Henry Spencer
e-Mail Notice: This communication may contain sensitive information.  If you
are not the intended recipient, or believe that you have received this
communication in error, do not print, copy, retransmit, disseminate, or
otherwise use the information contained herein for any purpose.  Please
alert the sender that you have received this message in error and delete the
copy that you received.

RE: Discovering the webapp path.

Posted by Keith Bohnenberger <kb...@mcdonaldbradley.com>.
You can try getting the java system property user.dir
Why do you need the path?  Can you get away with using
getResourceAsStream(...) instead?


> -----Original Message-----
> From: Sean Leblanc [mailto:SeanL@insightamerica.com]
> Sent: Wednesday, January 07, 2004 11:40 AM
> To: 'axis-user@ws.apache.org'
> Subject: Discovering the webapp path.
> 
> I'm hoping this isn't a FAQ somewhere. I did try googling and
searching
> the
> mailing list. Here goes:
> 
> Is there a way to, at runtime, discover the path that the webapp is
in? I
> can't really rely on the root path being any particular path and doing
> absolute path, because depending on how tomcat is started, root is in
> different places.
> 
> 
> TIA,
> 
> --
> Sean LeBlanc
> Software Developer
> insightamerica
> "Those who do not understand Unix are condemned to reinvent it,
poorly."
> --Henry Spencer
> e-Mail Notice: This communication may contain sensitive information.
If
> you
> are not the intended recipient, or believe that you have received this
> communication in error, do not print, copy, retransmit, disseminate,
or
> otherwise use the information contained herein for any purpose.
Please
> alert the sender that you have received this message in error and
delete
> the
> copy that you received.