Hi,

how can I get the location from the webapps-directory on my filesystem?

It's easy, if I use

String path = getServletContext().getRealPath("/");

and then cut off the last part:

int index = path.lastIndexOf(System.getProperty("file.separator"), path.length()-2 );

path = path.substring(0, index);

But this works only, if you have your webapplication unpacked in the file-system or if 
you have set unpackWars=true.

Now, I have set unpackWars=false, and now I get null for 
getServletContext().getRealPath("/").

Is there any possibility to get the name of the war-File an application is stored in 
or the name of the directory the war-file is stored in?

Thanks, 

Frank

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to