Brief description  about Online courses   join in Online courses
View Vasudha  Hegde 's Profile


Difference between HttpServlet and GenericServlet?
Asked by Vasudha Hegde | Jul 19, 2010 |  Reply now
Replies (2)
View Java Teacher 's Profile
Signature: public abstract class GenericServlet extends java.lang.Object implements Servlet, ServletConfig,

* GenericServlet defines a generic, protocol-independent servlet.
* GenericServlet gives a blueprint and makes writing servlet easier.
* GenericServlet provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface.
* GenericServlet implements the log method, declared in the ServletContext interface.
* To write a generic servlet, it is sufficient to override the abstract service method.

Signature: public abstract class HttpServlet extends GenericServlet implements

* HttpServlet defines a HTTP protocol specific servlet.
* HttpServlet gives a blueprint for Http servlet and makes writing them easier.
* HttpServlet extends the GenericServlet and hence inherits the properties GenericServlet.
Dec 24, 2010
View sunil kumar mondal 's Profile
Http Servlet is protocol dependent. It extends Generic Servlet and Generic servlet is protocol dependent.We usually don't implement the service method, bcoz HttpServlet class has already implemented it.fro generic, We implement service method, which is declared abstract.
Jul 19, 2010