web路径问题
2018-12-19 本文已影响5人
simple乐
<%--
./ 当前路径
/ 项目 路径 8080 后面的
../表示当前的上一路径
不写 项目路径 xzw 有跳转的 就上一路径
--%>
request.getServletPath(); 得到盘符一级
request.getContextPath(); 得到项目路径
request.getSession().getServletContext().getContextPath() 得到target下的路径