您的位置: 首页 > 文章 > Servlet跳转 Servlet跳转 分类: 文章 • 2024-02-16 22:09:04 服务端跳转与客户端跳转图示: 1.在Servlet中进行服务端跳转的方式: request.getRequestDispatcher("success.html").forward(request, response);服务端跳转可以看到浏览器的地址依然是/login 路径,并不会变成success.html 2.在Servlet中进行客户端跳转的方式: response.sendRedirect("fail.html"); 浏览器地址会发生变化