使用相对路径可能会有问题, 但使用绝对路径肯定没有问题
① 当前WEB应用的根路径:http://localhost:8080/contextPath/
》请求转发时:request.getRequsetDispatcher("/path/xxx.jsp").forward(request,response);
》web.xml 文件中映射 Servlet 访问路径
》各种定制标签中的 /
② WEB站点的根路径:http://localhost:8080/
》超链接:<a href="/TestServlet"></a>
》表达式的 action:<form action="/login.jsp"></form>
》重定向时:response.sendRedirect("/a.jsp")