关于req.getRequestDispatcher(path).forward(req, resp)转发问题
req.getRequestDispatcher(path).forward(req, resp)当path找不到正确路径时,会自动返回原来的servlet,再次执行该servlet,导致出现出现问题
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String path = "/pages/errors.jsp";
原创
2020-06-04 09:05:52 ·
3436 阅读 ·
0 评论