How to get path of current directory in Web Application

409 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 best solutions below

1
On

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