A servlet is extended by HttpServlet -----> Generic Servlet ---------->Then our Servlet. HttpServlet is needed b'coz we need to create the request & response objects of the HttpServletResponse & HttpServletRequest interfaces for which the implementation is given by the webcontainer. They say that Generic Servlet is equivalent to Servlet.
I feel, Generic servlet is kept as plain Servlet becaouse, GenericServlet is for servlets that might not use HTTP, like for instance FTP servlets. Of course, there's no such thing as FTP servlets, but they may try to plan for future growth when they designed the spec. Maybe some day there will be another subclass, but for now, always use HttpServlet.
So currently we use HTTPServlet for our webservers as it supports only HTTP. In future we may come across servlets with other protocols such as FTP, LDAP, ... etc. Hope So,
A servlet is extended by HttpServlet -----> Generic Servlet ---------->Then our Servlet.
I think you got that the wrong way around. Your servlet extends HttpServlet, which extends GenericServlet. Strictly speaking, that all is required of your servlet is that it implements the Servlet interface. But practically, HttpServlet does some useful things that just about all servlets will need to do, so it would be silly not to extend that insteaad.
As a hint, next time please UseAMeaningfulSubjectLine. "servlets" is way too generic to provide a clue what the question is about. And welcome to JavaRanch! [ October 03, 2008: Message edited by: Ulf Dittmer ]