tomcat-users mailing list archives

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

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:Sloan.Seaman@ptilabs.com]
>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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message