Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   JSP to get the WAR file location (http://www.velocityreviews.com/forums/t139335-jsp-to-get-the-war-file-location.html)

jrefactors@hotmail.com 12-16-2004 07:40 PM

JSP to get the WAR file location
 
Any API to get the current project location? Basically I need to get
the WAR file location,

For example, proj1.war is located here, and in the JSP code I can get
the path of WAR file location.

/appl/myproj/websphere/installedApps/proj1.ear/proj1.war/
any ideas? thanks!!


Chris Smith 12-16-2004 08:04 PM

Re: JSP to get the WAR file location
 
<jrefactors@hotmail.com> wrote:
> Any API to get the current project location? Basically I need to get
> the WAR file location,
>
> For example, proj1.war is located here, and in the JSP code I can get
> the path of WAR file location.
>
> /appl/myproj/websphere/installedApps/proj1.ear/proj1.war/
> any ideas? thanks!!


You can *probably* do it, but not in a reliable way. Search Google's
USENET gateway for articles by me containing "getCodeSource", and you
can experiment with and adapt the code there.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Ferenc Hechler 12-16-2004 08:17 PM

Re: JSP to get the WAR file location
 
With Tomcat you can get the context-path the following way:

webAppPath = getServletContext().getRealPath(".");



<jrefactors@hotmail.com> schrieb im Newsbeitrag
news:1103226014.311446.257910@c13g2000cwb.googlegr oups.com...
> Any API to get the current project location? Basically I need to get
> the WAR file location,
>
> For example, proj1.war is located here, and in the JSP code I can get
> the path of WAR file location.
>
> /appl/myproj/websphere/installedApps/proj1.ear/proj1.war/
> any ideas? thanks!!
>





All times are GMT. The time now is 05:03 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.