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

Answer Posted / niranjanravi

The diff is that inGeneracicServlet we had to implement the
service()method the GenericServlets service() method is
declared as abstract.But the Generic Servlet is not
implementing keeping the HttpSErvers in mind. Methods we
have in this class are
init()
log()
service()
While implementing the HTTP Servlet the service() method is
already implemented .service()method of HTTP sevlet is
declared as protected.the HTTPServlet is implementing
keeping the HttpSErvers in mind. Methods we have in this
class are
doGet(),doDelete(),doPost()

Is This Answer Correct ?    18 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the structure of the http response

677


Can we refresh servlet in client and server side automatically?

591


Why is init() method is used in servlets?

558


What exception should be thrown when servlet is not properly initialized?

553


What are the different ways we can maintain state between requests?

577






What do you mean by cgi in servlet?

631


How to get the current httpsession object?

653


Can we override servlet service method?

587


What is a servlet context object?

621


What are the exceptions thrown by servlets? Why?

625


Can we override destroy method in servlet?

504


Explain the different ways for servlet authentication?

532


What is new in ServletRequest interface ? (Servlet 2.4)

575


What is servlet name in web xml?

555


If a servlet is not properly initialized, what exception may be thrown?

627