Why does most servlets extend HttpServlet?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Why does the tag url-encode javascript and mailto links?
Which Taglibraury you used in your project? plz send me ans....which we r using generally
advantage of thread?
What is the relationship between local interfaces and container-managed relationships?
What is checkpoint? How to create checkpoints in our java projects?
What is preemptive and Non-preemptive Time Scheduling?
Write a program to show synchronization?
Which textcomponent method is used to set a textcomponent to the read-only state?
What is the difference between session and entity beans?
Difference Between java & javax
5 Answers Sun Microsystems, Wipro,
Write a java program to find out the sum of harmonic series : 1 + ½ + 1/3 + ……… up to nth term , for any value of n.
whats is mean by class.forName() whats the return type of class