This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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
subject: GenericServlet
It's not a secret anymore!