Post方法Servlet跳转

public void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {
  PrintWriter f= response.getWriter();
 /* f.println("");
  f.println("");
  f.println("html test");
  f.println("asdasdfasdf");
  f.println("");
  f.println("");
  f.close();*/
 
  //System.out.println("dadf");
  getServletConfig().getServletContext().getRequestDispatcher("/end.jsp").forward(request,response);
  //getServletConfig().getServletContext().getRequestDispatcher("/index.jsp").forward(request,response);

 }

}

你可能感兴趣的:(servlet,html)