What is the difference between response.sendRedirect() and request.getRequestDispatcher().forward(request,response) [duplicate]
问题 This question already has an answer here: RequestDispatcher.forward() vs HttpServletResponse.sendRedirect() 10 answers I have got a problem with my page jump when I use JAVA, if I use: response.sendRedirect("login.jsp") then I get this url: http://localhost:8080/login.jsp But if I use request.getRequestDispathcer("login.jsp").forward(request, response) then I get this url: http://localhost:8080/Shopping/login.jsp (the "Shopping" is the name of my module). What's the difference? 回答1: To simply