当前位置: 代码迷 >> 综合 >> request.getSession().getServletContext().getRealPath(/);
  详细解决方案

request.getSession().getServletContext().getRealPath(/);

热度:101   发布时间:2023-10-11 17:07:31.0


request.getSession().getServletContext()是获取的servlet容器对象,


相当于tomcat容器了。getRealPath("/") 获取实际路径,项目发布时,在容器中的实际路径。


D:\apache-tomcat-8.5.23\apache-tomcat-8.0.52\wtpwebapps\Springmvc_day01\(Springmvc_day01是项目名)
 

转载:https://blog.csdn.net/lbqlzch/article/details/101076712?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

  相关解决方案