File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HttpServlet and GenericServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServlet and GenericServlet" Watch "HttpServlet and GenericServlet" New topic

HttpServlet and GenericServlet

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
What is the difference between
a GenericServlet and an HttpServlet.
(I know that the second one exrends the first).
I want to know the context of usage.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
GenericServlet is one which is generic, that is, it does not provide any protocol. HttpServlet supports Http protocol.
Generic servlet is useful when you wish to write your own protocol, for example your own http servlet or ftp servlet.
Httpservlet on the other hand provides ready to use features. I find this easy, because, it saves me LOTS of time and effort doing reaserch on some protocol.
prasad Chandrasekaran Iyer

Joined: Jan 14, 2004
Posts: 18
generic servlet doesn't have the http functionality where Httpservlet does.
I agree. Here's the link:
subject: HttpServlet and GenericServlet
It's not a secret anymore!