aspose file tools
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 Badass: Making Users Awesome this week in the Game Development 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: 422

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 | |
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:
subject: destroy() method