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

What are the type of protocols used in httpservlet?

624


what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?

580


What is cookie? Why is cookie used?

594


What is servlet lazy loading?

707


How are filters?

595






Why jsp is better than servlet?

541


What is java servlet?

618


How do we share data using 'getservletcontext ()?

553


What does the term localization refer to?

594


What is cookie in servlet?

603


What is servlet and its types?

567


What is http servlet? Explain with the help of an example.

590


Difference between GET and POST?

720


What is servlet in tomcat?

571


Which event is fired at the time of setting, getting or removing attribute from application scope?

626