What are the difference between HttpServlet and
GenericServlets?

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 ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why jsp is better than servlet?

515


What’s the difference between sendredirect and forward methods

541


What are some disadvantages of storing session state in cookies?

570


Which exception is thrown if servlet is not initialized properly?

657


How httpservlet is different from the genericservlet?

546






What is meant by servlet? What are the parameters of the service method?

552


What do you mean by cgi?

518


What are its drawbacks of cgi?

549


Explain the difference between a web server and a web container?

491


A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?

576


What is the inter-servlet communication?

678


What is meant by a servlet?

580


What is life cycle of Servlet?

588


How to notify an object in session when session is invalidated or timed-out?

606


How do we translate jsp?

554