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
Which event is fired at the time of setting, getting or removing attribute from application scope?
What is the purpose of inter-servlet communication?
How does tomcat servlet container work?
Explain session tracking and its importance?
Why servlet is faster than jsp?
What is servlet name in web xml?
What is webservlet?
what is servlet chaining?
What do you mean by annotations in servlet?
What is url encoding and url decoding
What is the difference between forward () and sendredirect () functions in servlet? Explain
What are the different session tracking techniques?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
What’s the difference between genericservlet and httpservlet?
What is the use of servlet wrapper classes?