HttpServlet的用法

public class LoginServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//      System.out.println("Sky1in3");
    }
    
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

}

GET请求方式是不安全的,为了安全起见,在 doGet(HttpServletRequest req, HttpServletResponse resp) 方法中直接调用 doPost(req, resp) 方法。

你可能感兴趣的:(HttpServlet的用法)