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

Which exception is thrown if the servlet is not initialized properly?

807


What is servlet api used for conneting database?

969


Why HttpServlet class is declared abstract?

894


What is the major difference between context parameter and context attribute?

861


What are the features added in Servlet 2.5?

980


What are the types of servlets? Explain

945


What is session tracking?

921


Which method is called when reference variable is passed in system.net?

2092


Describe servlet?

796


How to upload a file to the server using servlet?

762


What are the servlet events?

797


What is difference between server and servlet?

829


Explain the difference between servlet and cgi?

842


How can you use a servlet to generate a plain text instead of html?

891


What is the workflow of a servlet?

933