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 common methods that are included in the http servlet class?

812


Is that servlet is pure java object or not?

844


What is ServletContext object?

865


What is the type of method for sending request from http server?

826


Why is servlet used?

922


What are the exceptions thrown by servlets? Why?

861


hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code

2543


How to notify an object in session when session is invalidated or timed-out?

858


What is the major difference between servlet and applet?

781


How the JSP file will be executed on the Server side?

898


Explain the role of dispatcherservlet and contextloaderlistener.

911


What is java servlet session?

743


What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?

858


What is war file?

802


What are some advantages of storing session state in cookies?

813