What is the difference between GenericServlet and HttpServlet?

GenericServlet is for servlets that might not use HTTP, like for instance FTP service.As of only Http is implemented completely in HttpServlet. The GenericServlet has a service() method that gets called when a client request is made. This means that it gets called by both incoming requests and the HTTP requests are given to the servlet as they are.[qu]What are the differences between GET and POST service methods?

Showing Answers 1 - 2 of 2 Answers

Arun Kumar

  • Sep 14th, 2006
 

GenericServlet is a class in javax.servlet package which implements the Servlet interface.This class is independant of the protocol.

HttpServlet is a class in javax.servlet.Http package which extends the GenericServlet class.All Http servlets must extend the HttpServlet class.

  Was this answer useful?  Yes

biswal_24

  • Nov 13th, 2006
 

if we use Genric then the service() is required to be overridden but in case of Http Servlet it is already there and no need to override.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions