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