JSP to get the WAR file location

J

jrefactors

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!!
 
C

Chris Smith

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
 
F

Ferenc Hechler

With Tomcat you can get the context-path the following way:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,591
Members
45,100
Latest member
MelodeeFaj
Top