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

How do you communicate in between Applets and Servlets?

829


What is Client-Server Computing?

2123


Explain the differences between jsp and servlet.

752


Should I override the service() method?

885


What is the procedure for initializing a servlet?

776


How is the get () method different from the post() method?

757


If servlet receives multiple requests, how many objects will it create?

1114


Define context initialization parameters.

817


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

783


Define declaration.

848


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

858


List some life cycle methods of a servlet.

811


Can you explain in detail 'javax.servlet' package?

781


How can the session in servlet be destroyed?

900


Why don't we write a constructor in a servlet?

811