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 the relationship between an event-listener interface and an event-adapter class?

0 Answers  


which deployment descriptor element is used to configure the authentication method? a. auth-config b. login-config c. sec-config

1 Answers  


What is the infobus?

0 Answers  


How to do registration form using struts and hibernate?

1 Answers  


what are memory considerations of jsp compares to other web components?

0 Answers   TCS,






What is a clone?

0 Answers  


What is servlet preinitialization?

3 Answers   iFlex,


What is multithread synchronizing ?

4 Answers   Sun Microsystems,


What are the benefits of detached objects?

0 Answers  


can any one tell me how to learn good coding techniques

3 Answers  


What is deadlock?

2 Answers  


Suppose there are 3 combo box. SELECT COUNTRY SELECT STATE SELECT CITY if i select any country from country conutrylistbox values in the state will get automatically inserted with database values>> THEN on selection of state city will be inserted in city combo box If you can help then please Help me...

2 Answers   HCL,


Categories