jdk1.8中获取项目绝对路径和项目路径

request.getSession().getServletContext().getRealPath("")  获取项目的绝对路径,含着项目的名称。

request.getSession().getServletContext().getContextPath() 获取项目名称 如:hzz。

原文地址:https://www.cnblogs.com/xiangxinhouse/p/9278360.html