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
How can a servlet be used to generate plain text instead of html?
What are the annotations used in servlet 3?
What do you mean by cgi and what are its drawbacks?
What do you mean by mime type?
Explain the difference between a web server and a web container?
Which application server is best for java?
Explain the concept of ssi ?
If some new data has entered the database, explain how can a servlet refresh automatically?
How does tomcat servlet container work?
What is a generic servlet?
What is servlet mapping?
Describe in brief RequestDespatcher?
What is the default http method in the servlet?
How do you load an image in a Servlet?
What are the difference between session and cookies in servlet? Explain