Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is Generic Servlet and how it is different from Http
Servlet?

Answer Posted / qim2010

Both these classes are abstract but the differences are

A GenericServlet has a service() method to handle
requests.
The HttpServlet extends GenericServlet and adds support
for HTTP
protocol based methods like doGet(), doPost(), doHead()
etc. All
client requests are handled through the service() method.
The service method dispatches the request to an appropriate
method like doGet(), doPost() etc to handle that request.
HttpServlet also has methods like doHead(), doPut(),
doOptions(),
doDelete(), and doTrace().


GenericServlet is Protocol independent. GenericServlet is
for servlets
that might not use HTTP (for example FTP service).
But HttpServlet is protocol dependent (i.e. HTTP).

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get the actual path of servlet in server?

1225


Which HTTP method is non-idempotent?

1133


When jsessionid is created?

1046


Can we override destroy method in servlet?

986


What is a servlet engine?

1041


What are the different methods involved in generic servlet?

1094


Difference between httpservlet and generic servlets?

1105


Which event is fired at the time of project deployment and undeployment?

1322


Which is the methods of generated servlet?

1225


What is difference between cookies and httpsession?

1095


How the JSP file will be executed on the Server side?

1140


What is servlet and its life cycle?

1122


How do you design microservices?

1084


What are the differences between the servletconfig interface and the servletcontext interface?

1187


How do I use cookies to store session state on the client?

970