Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When Servlet's delete() method is called?

 
Prabhat Gupta
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi EveryOne ,
In Sevlet life-cycle,the service() method calls the overriden doGet() or doPost() method which ever is applicable . After that the thread that is allocated for service() method will be destroyed by container.

After that i GUESS ,the overriden destroy() method will be called to kill the servlet object. But who does call this destroy() method??

If destroy() method is called every time then i think that for each request
container has to load the servlet-class and then instantiate it.

Also what does it means by loading the class and instantiating it.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
destroy() is a call back method. Which you wont have controll on it, it automatically called by container whenever needed.
Example: it is called if you undeploying your application, or if you shutdown the server..etc..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic