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 the use of send redirect () method?

590


How many servlet objects are created?

567


How native code can be used in a servlet?

3523


Can you use javascript in servlets?

604


What’s the use of the servlet wrapper classes??

644






What is the effective way to make sure all the servlets are accessible only when user has a valid session?

572


What is ServletConfig object?

612


How to generate the server side programming and the advantages of it over the other languages?

565


What is the major difference between servlet and applet?

544


What is servlet instance?

544


How can we invoke another servlet in a different application?

709


Can servlet have a constructor ?

597


What do you mean by filter in servlet?

538


What must be implemented by all servlets?

578


How do I know if java is running on linux?

607