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 Client-Server Computing?

1897


Explain jsessionid?

619


What do you mean by url pattern in servlet?

631


What is servlet api used for conneting database?

696


What is a server side include (ssi)

570






Why do we have servlet wrapper classes?

578


What is the requirement of servlet config and servlet context implemented and how are they implemented?

539


What are the differences between servlet context vs servlet config?

578


What are the ways to handle multi-threading in servlets?

595


When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

568


How will two or three servlets interact or communicate with each other?

912


When should you prefer to use doget() over dopost()?

661


What is the main purpose of java servlets?

587


How to read request headers from servlets?

562


What is the directory structure of a war file?

711