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

What is servlet container. how it works?

879


What do you mean by a filter and how does it work?

713


Is java servlet still used?

766


How do we translate jsp?

773


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

861


What's the difference between authentication and authorization?

796


Can we use the constructor, instead of init(), to initialize servlet?

830


What is the servlet?

834


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

769


Which event is fired at the time of setting, getting or removing attribute from application scope?

874


What's the advantages using servlets than using cgi?

732


Write the code to get the server information in servlet.

784


What is servlet and its use?

815


What is the life cycle of a servlet?

1103


Explain the custom jsp tags and the beans.

795