microrock
转发:
RequestDispatcher rd = request.getRequestDispatcher("/WEB-INF/main.jsp"); rd.forward(request, response);
这里是将请求转发给了main.jsp界面,前端浏览器访问URL不会做改变
重定向:
response.sendRedirect("../error.jsp");//跳到失败界面
这里是将请求URL重定向到error.jsp界面,前端浏览器访问URL会做改变
Copyright @ 2024 microrock Powered by .NET 9.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster