why are extending GenericServlet and why are extending
HttpServlet explain?

Answer Posted / dinesh goud

with out extending those servlets,we have to write all the methods in Servlet interface..............In order to write all the methods in Servlet interface.we go for extending GenericServlet and HttpServlet............

public UserServlet implemetns Servlet
{
provides bodies for all methods;
}
public UserServlet extends GenricServlet
{
provides bodies for methods ur wish and well
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is Request Dispatcher?

791


Which event is fired at the time of session creation and destroy?

865


Tell us something about servletconfig interface.

576


Who is responsible for writing a constructor?

769


How to generate the server side programming and the advantages of it over the other languages?

554






What is servlet name in web xml?

547


Which exception is thrown if the servlet is not initialized properly?

582


Explain web container.

562


List out the difference between ServletConfig and ServletContext?

598


What do you mean by filter in servlet?

534


What is ServletConfig object?

602


Explain get and post.

643


What is cookies in servlet with example?

514


What are sessions in servlets?

568


Is tomcat a servlet container?

568