Edit Edit

Java Servlet FAQ


How do you handle both HTTP GET and POST requests in the same servlet?


Implement doGet() in your servlet and in your doPost() method, forward the call to doGet():

    public void doPost(HttpServletRequest req, HttpServletResponse res)
                      throws ServletException, IOException
    {
        doGet(req, res);
    }



Last updated 04/17/2001 11:08:39 PM