my dog learned polymorphism
The moose likes Servlets and the fly likes GenericServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "GenericServlet" Watch "GenericServlet" New topic


sumit Sanghai

Joined: Nov 05, 2004
Posts: 5
What is the difference between HttpServlet and GenericServlet?
Medha kamat

Joined: Aug 22, 2002
Posts: 21
GenericServlet is protocol independent servlet which implements Servlet interface.HttpServlet extends GenericServlet and adds http specific tasks to it.It is an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these:

doGet if the servlet supports HTTP GET requests
doPost for HTTP POST requests
doPut for HTTP PUT requests
doDelete for HTTP DELETE requests
init and destroy to manage resources that are held for the life of the servlet getServletInfo which the servlet uses to provide information about itself
I agree. Here's the link:
subject: GenericServlet
It's not a secret anymore!