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
What is cookie in servlet?
What do you mean by a filter and how does it work?
Explain the servlet context.
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
Why doesn’t a servlet include main()?
Which protocol will be used by browser and servlet to communicate
Explain the features are in servlet 3?
What do you mean by default initialization in java servlet?
What is servlet initializer?
What’s the use of the servlet wrapper classes??
What is servletconfig?
When a servlet accepts a call from a client, it receives two objects. What are they?
What is the use of send redirect () method?
What is the difference between Difference between doGet() and doPost()?
What is the use of servletconfig interface?