File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

service() method

 
Devaki Nihar
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read somewhere that service() method shd not overriden.
I have written a simple servlet which extends HttpServlet and overriden service() method there.
It works .
Then which is the correct practice? why ?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Override either doPost or doGet (there are others too but they aren't commonly used).
The servlet container will call the service method.
The service method checks to see if the request is of type POST or type GET.
It will then call the appropriate method accordingly.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic