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
If a servlet is not properly initialized, what exception may be thrown?
What is Servlets and explain the advantages of Servlet life cycle?
What is difference between PrintWriter and ServletOutputStream?
Which interface should be implemented by all servlets?
Define context initialization parameters.
What do you mean by interservlet communication?
What is the process for chaining servlet?
What is the workflow of a servlet?
What do you mean by request dispatcher in servlet?
Difference between java beans & servlets?
What are the functions of an intercepting filter?
What are the difference between session and cookies in servlet? Explain
Explain servlet.
Why is a constructor needed in a servlet even if we use the init method?
What do you mean by singlethreadmodel interface?