Saturday, March 21, 2015

Difference between genericservlet and httpservlet


Difference between genericservlet and httpservlet



GenericServlet

HttpServlet

GenericSevlet is the sub class of HttpServlet

HttpServlet is the sub class of GenericSevlet
GenericServlet belongs to javax.servlet package

HttpServlet belongs to javax.servlet.http package
GenericServlet is an abstract class it can handle all types of protocols

HttpServlet handle only Http specific protocols.
In GenericServlet class, we use only service method

HttpServlet class, we use doGet() and doPost().
Generic Servlet are protocol independent

Http Servlet are protocol dependent
GenericServlets does not provide that supports cookies, sessions etc.

HttpServlets provides methods that supports cookies,sessions etc.
GenericServlet is used for small data transfer
HttpServlet is used for huge data transfer

0 comments:

Post a Comment