How to get path of current directory in Web Application

400 views Asked by At

While I try to get path of current dir like bellow in my project it gives the location of where eclipse is downloaded.

String Cuurentdir= System.getProperty("user.dir");

I want path of my project dir.

Note- Using tomcat as a server.

1

There are 1 answers

1
Rohit Ramtirthe On

String workingDir = (File)servletContext.getAttribute(ServletContext.TEMPDIR);