views:

821

answers:

1

I have tomcat extract in one place and my webapps directory may be somewhere else. Then how to get absolute path of my web application? . I have my file handling programme inside webapps and i want to find absolute path of my webapps or my application directory(starting from c:/ or /home/use/ ../../webapp/mywebapplication like that ). Thing is I dont have control on who/where my application is going to be deployed ?

+4  A: 

see ServletContext.getRealPath

Maurice Perry