You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Kulkarni <ku...@yahoo.com> on 2005/04/12 00:23:22 UTC

[OT] get real path to jar file in jsp folder

Hi
Here is a data structure in my web project, 

c:\myproject -
              |
               - pages -
                        |
                         my.jar
   WEB-INF-
           |
           classes
           lib

all my servlets are in classes folder,
how do i get the absoulte path for my.jar in my
servlet,
I need to read manifest in this jar file through my
servlet.
this code should work on all platforms

Ashish

A$HI$H


		
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] get real path to jar file in jsp folder

Posted by Patrick L Archibald <ma...@patrickarchibald.com>.
How about:

String realPath = getServletContext().getRealPath("");

Then modify to get to the correct directory.

Thanx, PLA



Ashish Kulkarni wrote:

>Hi
>Here is a data structure in my web project, 
>
>c:\myproject -
>              |
>               - pages -
>                        |
>                         my.jar
>   WEB-INF-
>           |
>           classes
>           lib
>
>all my servlets are in classes folder,
>how do i get the absoulte path for my.jar in my
>servlet,
>I need to read manifest in this jar file through my
>servlet.
>this code should work on all platforms
>
>Ashish
>
>A$HI$H
>
>
>		
>__________________________________ 
>Yahoo! Mail Mobile 
>Take Yahoo! Mail with you! Check email on your mobile phone. 
>http://mobile.yahoo.com/learn/mail 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org