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
Difference between httpservlet and generic servlets?
Who is responsible for writing a constructor?
What is servlet used for?
What is the difference between the http servlet and generic servlet?
What are the different methods involved in the process of session management in servlets?
How is an application exception handling is done using a servlet?
Explain the methods of request dispatcher in servlet?
What is the default http method in the servlet?
Write a program to show the functionality of doget and dopost method?
How to get the path of servlet in the server?
What is the main purpose of java servlets?
How can we refresh automatically when new data is entered into the database?
What do you mean by singlethreadmodel interface?
What is difference between get and post method?
How do you find out what client machine is making a request to your servlet