简体   繁体   English

如何在 Web 应用程序中获取当前目录的路径

[英]How to get path of current directory in Web Application

While I try to get path of current dir like bellow in my project it gives the location of where eclipse is downloaded.当我尝试在我的项目中获取当前目录的路径时,它给出了下载 eclipse 的位置。

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

I want path of my project dir.我想要我的项目目录的路径。

Note- Using tomcat as a server.注意 - 使用 tomcat 作为服务器。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM