• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServlet

 
Suresh Babu Seeram
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

public abstract class HttpServlet
extends GenericServlet
implements java.io.Serializable
Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these:
doGet, if the servlet supports HTTP GET requests
doPost, for HTTP POST requests
doPut, for HTTP PUT requests
doDelete, for HTTP DELETE requests
init and destroy, to manage resources that are held for the life of the servlet
getServletInfo, which the servlet uses to provide information about itself

above quote is from java doc...
Why subclass of HttpServlet must implements any of these methods... ??
Ok..If it is abstract it must implements its abstract methods or declare the class as abstract.. am i right??
...why any of thesee methods....???
If all methods doGET,doPost..etc are abstract.. then subclass must implement all methods... not any one....??
thanks in advance..
[ February 17, 2002: Message edited by: Suresh Babu Seeram ]
 
Raj Kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the reason is, its just the class that has been declared as abstract. None of the methods are declared as abstract. I think all methods have an empty body. So no need to override all the methods. Hope this helps!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic