Header Ads

  • Breaking Now

    What is the difference between GenericServlet and HTTPServlet?

    GenericServlet is an abstract class that defines a generic, protocol-independent servlet.Any protocol dependent servlet has to extend this class in order to provide a specific implementaion and override service method.e.g . HTTPServlet class extends GenericServlet class.
     
    GenericServlet has a service(ServletRequest req, ServletResponse res) method which is called by the servlet container to allow the servlet to respond to a request.
     
    HttpServlet extends GenericServlet and adds support for doGet(), doPost(), doHead() methods (HTTP 1.0) plus doPut(), doOptions(), doDelete(), doTrace() methods (HTTP 1.1). Both these classes are abstract.
     

    4 comments:

    1. Good One this blog has lot of information

      ReplyDelete
    2. gud one answer, i get different and well define from others blogs.

      ReplyDelete
    3. i got well described answer from others blogs.

      ReplyDelete
    4. it is too good if you mentioned about HttpServletRequest and HttpServletResponse are arguments as in doGet(HttpServletRequest request , HttpServletResponse response);
      doPost(HttpServletRequest request , HttpServletResponse response);

      ReplyDelete

    Post Top Ad

    Post Bottom Ad