jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes destroy() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "destroy() method" Watch "destroy() method" New topic

destroy() method

Harikrishna Gorrepati
Ranch Hand

Joined: Sep 23, 2010
Posts: 423

1. Because destroy() is callback method which is called by Container when the server is about to shutdown, Do we need to override it (or) leave it to the container.
2. Even though I write couple of System.out.println() statements in destroy() method and shutdown the server, they are not printed on the console.

Please advice.

OCPJP 6.0-81% | Preparing for OCWCD
http://www.certpal.com/blogs/cert-articles | http://sites.google.com/site/mostlyjava/scwcd |
Javin Paul
Ranch Hand

Joined: Oct 15, 2010
Posts: 294

Hi Hari,

As per my knowledge destroy() method is called before a Servlet gets unloaded from Container. though its upto container implementation on which other cases its provides callback to destroy() method.


SQL Query Interview Question
I agree. Here's the link: http://aspose.com/file-tools
subject: destroy() method
jQuery in Action, 3rd edition