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
What is the use of servletconfig interface?
What is servlet lazy loading?
Can filter be used as request or response?
What is the inter-servlet communication?
What do you mean by servlet?
How do we go with database connection and log4j integration in servlet?
Why the concept of single thread model interface is used?
What are some disadvantages of storing session state in cookies?
How do you invoke a Servlet? What is the difference between doPost method and doGet method?
Are Servlets Thread Safe? How to achieve thread safety in servlets?
Which exception is thrown if the servlet is not initialized properly?
What is servlet in web technology?
What are the type of protocols used in httpservlet?
What is servlet and how it works?
What is a web application and what is it’s directory structure?