tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Properties
Date Fri, 27 Aug 2004 19:32:44 GMT

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 []
>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
>your applications jar?
>For instance, I have an application war named test.war and it deploys
>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
>from there?

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:
For additional commands, e-mail:

View raw message