Can sendRedirect() act as a post method instead of get? - jsp/servlets

前端 未结 6 1857
暖寄归人
暖寄归人 2020-12-29 07:18

I have a simple form which accepts a username and a password. I have to use sendRedirect() method for the page to redirect to one page if log in is valid and to

6条回答
  •  自闭症患者
    2020-12-29 08:20

    Check out this once :

    String url = "http://www.mysite/servlets/theServlet";
    RequestDispatcher dispatcher = servletContext().getRequestDispatcher(url);
    dispatcher.forward(request, response);
    

提交回复
热议问题