fannn

问题:页面跳转到/UserManager/LoginCLServlet,就一直没有反应,无法继续执行下去
(servlet页面跳转没有反应)

解决:


doPost()方法里面必须写成这样

正确的写法:
 public void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {

  doGet(request,response);
 }


错误的写法
public void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {

  response.setContentType("text/html");
  PrintWriter out = response.getWriter();
  out.flush();
  out.close();
 }


非常幼稚的错误:因为我前面   form  表单传值的方法 是post ,所以,传值的方法调用的是  doPost()方法,所以才会出现一直无法执行的问题。

 

关键词:用户 登陆 跳转 doPost()

 

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2021-07-31
  • 2021-12-21
  • 2022-12-23
  • 2021-12-05
  • 2021-12-05
  • 2022-12-23
  • 2021-11-02
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2021-09-25
  • 2021-12-05
  • 2021-12-05
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案