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

When a servlet accepts a call from a client, it receives two objects. What are they?

753


What are the differences between the servletconfig interface and the servletcontext interface?

572


How can you create a session in servlet?

585


What if we pass negative value in load-on-startup?

791


What’s the difference between sendredirect and forward methods

560






How many objects of a servlet is created?

782


What are sessions in servlets?

565


Hi frnd can i any one kindly can post for me portlet,hibernate and spring example application and with flow explantion configuration using Jdeveloper.and related links ar tutorials kindly please send me .its urgent for me .thanks in advance...........else can any one send to kondaiah.goddeti@gmail.com

1736


How to handle exceptions thrown by application with another servlet?

606


What is the difference between jsp and servlet life cycle?

680


What is load-on-startup in servlet?

580


Can you send an authentication error from a servlet?

511


When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?

560


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

568


How can you use a servlet to generate a plain text instead of html?

581