why are extending GenericServlet and why are extending
HttpServlet explain?
Answer Posted / mahesh
There are some reasons are exited they are as follows
-->GenericServlet is protocol independent where as HttpServlet is protocol dependent .
-->Due to the un implementation of http protocol GenericServlet will not provide any flexibility for the developers to specify different types of request at client mechine.
i.e. If you specify any type of request at client mechine like get,post,head.....when at server side GenericServlet able to process all this request as a normal request by calling service().
-->Due to the imlementation of HttpProtocol in HttpServlet,vl provide very good flexibility for the request at client mechine .
i.e. If we specify the request types like get,post...client mechine then HS vl execute doGet(),doPost().....respectivly at serverside.
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Why do we have servlet listeners?
What is cookies in servlet with example?
What are the differences between the servletconfig interface and the servletcontext interface?
What is cgi and what are its drawbacks?
What is url encoding and url decoding
What is webservlet?
What is session tracking?
What are the steps that are required to handle the multi-threading?
What do you mean by servlet?
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
What is ServletConfig object?
How do you define a servlet?
Difference between get and post in java servlets?
Why session tracking is needed?
What is servlet collaboration?