SERVLET
Hi Everyone!
Hope all are good.............
Here i am sharing the article about the topic--"HttpServlet vs GenericServlet".
1.HttpServlet is protocol depends and GenericServlet is a protocol independent means HttpServlet can works with only http protocol and GenericServlet can work with any protocol.
2.GenericServlet is a member of Javax.Servlet package and HttpServlet is member of Javax.Servlet.http package.
3.GenericServlet is abstract class and which extends object class and implements servlet interface as well as ServletConfig and serializable interface
HttpServlet is child of GenericServlet and implement serializable interface.
HttpServlet is a child of GenericServlet and implements serializable interface in it.
Interface Servlet{
}
Interface ServletConfig{
}
class object{
}
class GenericServlet extends java.lang.object implements Servlet,ServletConfig{
}
OR
------
abstact class HttpServlet extends GenericServet{
}
4.GenericServlet only use the service() method for access the request and send the response in background but HttServlet we have the doget(), dOpost(), doTrace(), doDelete(), doHead() etc.