Originally posted by yathamshetti ramchander:
hai,
->i working with generic servlet and httpservlet
Why?
->why we have to use httpservlet,instead of generic servlet.
Who said you
have to?
->what is the diff between generic servlets and http servlets.
The differences can be seen here:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServlet.html The methods particular to HttpServlet are listed first.
Then, the methods inherited from GenericServlet are listed.
When the servlet spec was first conceived, it's creators realized that this concept could apply to several server protocols. So, rather than add a bunch of methods to the servlet interface that would be igored by any implementation other than HTTP (such as doPost, doGet), they designed the generic servlet with no protocol specific methods. Then, when desiging a servlet interface specifically for HTTP, they inherited from this generic servlet and added HTTP specific methods.
At this time, there are no servlet implementations for protocols other than HTTP; at least none are known to me.
In other words, there is almost no point in extending GenericServlet while building web-apps.