
what is diff between generic servlets and httpservlets

Difference between GenericServlet and HTTPServlet:
1)GenericServlet belongs to javax.servlet package while HttpServlet belongs to javax.servlet.http package.
2)GenericServlet is an abstract class which extends Object and implements Servlet, ServletConfig and java.io.Serializable interfaces. HTTPServlet is an abstract class which extends GenericServlet and implements java.io.Serializable.
3)The direct subclass to GenericServlet is HttpServlet. To write a GenericServlet you need abstract service() to be overridden. A subclass of HttpServlet must override at least one method of doGet(), doPost(),doPut(), doDelete(), init(), destroy(), getServletInfo().
4)GenericServlet is a protocol-independent servlet while HTTPServlet is a protocol dependent servlet.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.