This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes When Servlet's delete() method is called? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "When Servlet Watch "When Servlet New topic
Author

When Servlet's delete() method is called?

Prabhat Gupta
Ranch Hand

Joined: Jan 22, 2008
Posts: 135
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

Joined: Mar 05, 2008
Posts: 168
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..


Ravi Kumar
SCWCD 5 - 89%, SCJP 1.4 - 90%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When Servlet's delete() method is called?
 
Similar Threads
Call destroy() inside init()
when destory() gets called ??
Servlet
Enthuware Q
Question No: 10 (Question ID: 711) from jdiscuss