Hi,
You could try ServletContext#getRealPath("/").

That will only work when a WAR is unpacked.  Servlet containers are not
required to support unpacked WAR deployment, and will return null to all
getRealPath calls if running the webapp from a packed WAR.

Moreover, your question suggests Tomcat-specific code, which is a
Something To Be Avoided If Possible.  Stick to the Servlet Spec as much
as you can.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Seaman, Sloan [mailto:[EMAIL PROTECTED]
>Sent: Friday, August 27, 2004 3:29 PM
>To: 'Tomcat Users List'
>Subject: Properties
>
>Is there any way to programmatically get the location that Tomcat
expanded
>your applications jar?
>
>For instance, I have an application war named test.war and it deploys
to
>c:/tomcat/webapps/test/etc.....
>
>I'd like to be able to retrieve the c:/tomcat/webapps/test.
>
>Is there anyway to get that or do I have to get the catalina_home and
go
>from there?
>
>--
>Sloan




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to