6-服务器端转发和客户端重定向
0
Word Count: 107(words)
Read Count: 1(minutes)
服务端转发
==request.getRequestDispatcher(“demo7”).forward(request,response);==
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| demo6 public class demo6Servlet extends HttpServlet {
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("demo6"); request.getRequestDispatcher("demo7").forward(request,response);
} }
dmeo7 public class demo7Servlet extends HttpServlet {
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("demo7");
} }
|
路径不发生改变
客户端重定向
发送改变并且有两个请求