Why does most servlets extend HttpServlet?

Answers were Sorted based on User's Feedback



Why does most servlets extend HttpServlet?..

Answer / surajkumar.java

Yes, HttpServlet simplifies the handling of HTTP protocol but there is no hard and fast rule that the servlet class must extend abstract HttpServlet class. it may extend GenericServlet class to make the Servlet protocol independent.

Is This Answer Correct ?    8 Yes 1 No

Why does most servlets extend HttpServlet?..

Answer / surajkumar.java

Almost all servlets written today are designed to use the HTTP
protocol, so most servlets currently extend the
javax.servlet.http.HttpServlet class.

Is This Answer Correct ?    4 Yes 1 No

Why does most servlets extend HttpServlet?..

Answer / magesh

The GenericServlet which is the base class of HttpServlet
does not have any handler methods (doGet or doPost) to
entertain the request.Since all web based application or
HHTP based we are extending the HttpServlet and overrinding
atleast one of the hanler methods to entertain the incoming
requests

Is This Answer Correct ?    3 Yes 1 No

Why does most servlets extend HttpServlet?..

Answer / dhiraj

All servlet classes extend the HttpServlet abstract class.
HttpServlet simplifies writing HTTP servlets by providing a
framework for handling the HTTP protocol. Because
HttpServlet is abstract, your servlet class must extend it
and override at least one of its methods. An abstract class
is a class that contains unimplemented methods and cannot be
instantiated itself.

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More Advanced Java Interview Questions

what is domain,give me some brief information about that?

1 Answers  


What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

0 Answers  


Difference between hashmap and hashtable?

0 Answers  


what are design patterns in java?give with example?

2 Answers   HCL, iGate,


difference between Abstract and Interface?

2 Answers   HCL, Infotech,






What is permgen or permanent generation?

0 Answers  


cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..

0 Answers  


we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?

0 Answers   IBM,


What are the steps involved in developing an RMI object?

1 Answers  


What is scalable, portability in the view of J2EE?

0 Answers  


How do you iterate in Hashmap?

1 Answers   HCL, Infotech,


what's the main difference between unix os and linux os?

2 Answers   TCS,


Categories