想●致

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

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

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

posted @ 2018-07-07 20:34  相心  阅读(687)  评论(0编辑  收藏  举报