why are extending GenericServlet and why are extending
HttpServlet explain?

Answer Posted / venu bandla

because be extending generic servlet we can access only
common methods of servlet interface,and we fourcefully
access the httpservlet methods by type casting the
servletRequest and ServletResponse objects into
httpServletRequest and HttpServletResponse.so this procedure
is not recommended because of redendent code.so we are
extending the HttpServlet class

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can an existing session be invalidated?

872


What do you mean by the servlet chaining?

786


How do we call one servlet from another servlet?

766


How to rectify errors in java servlet while compilation?

713


Difference between httpservlet and generic servlets?

841


What do you mean by default initialization in java servlet?

864


What is Servlets and explain the advantages of Servlet life cycle?

814


What is the need of session tracking in web application?

785


Explain servlet.

784


What are the uses of servlets?

813


What is servlet and its types?

777


What is cgi?

785


If a servlet is not properly initialized, what exception may be thrown?

868


What is the dispatcher servlet?

730


How do we go with database connection and log4j integration in servlet?

918