What is Generic Servlet and how it is different from Http
Servlet?
Answer Posted / qim2010
Both these classes are abstract but the differences are
A GenericServlet has a service() method to handle
requests.
The HttpServlet extends GenericServlet and adds support
for HTTP
protocol based methods like doGet(), doPost(), doHead()
etc. All
client requests are handled through the service() method.
The service method dispatches the request to an appropriate
method like doGet(), doPost() etc to handle that request.
HttpServlet also has methods like doHead(), doPut(),
doOptions(),
doDelete(), and doTrace().
GenericServlet is Protocol independent. GenericServlet is
for servlets
that might not use HTTP (for example FTP service).
But HttpServlet is protocol dependent (i.e. HTTP).
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
How can we create deadlock situation in servlet?
How to get ip address in jsp login page and how to validate like 127.1.0.1 all should not be greater than 255
Can we override servlet service method?
How many servlet objects are created?
Why is Servlet so popular?
What if we pass negative value in load-on-startup?
Can you create a deadlock condition on a servlet?
What are important features of Servlet 3?
Can you use javascript in servlets?
When jsessionid is created?
What is the functionality of actionservlet and requestprocessor?
What is the life cycle of a servlet?
What is meant by Servlet? What are the parameters of service method?
Describe servlet?
How native code can be used in a servlet?