• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris


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 ]
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!
Message for you sir! I think it is a tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic