方法一:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { System.out.println("------- come here -------");
response.setStatus();
response.setHeader("Location", "/day0106/servlet/demo2"); }
方法二:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.sendRedirect("/day0106/servlet/demo1");
}