File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet Life Cycle Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Servlet Life Cycle" Watch "Servlet Life Cycle" New topic
Author

Servlet Life Cycle

Pubudu Fernando
Greenhorn

Joined: Oct 12, 2011
Posts: 5
hii i'm new to servlets and i've read that the container calls destroy() on the servlet.. so then how would the container know when to call destroy()?? does it do so when the server is about to shut down?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56202
    
  13

It can do so whenever it likes. Surely it will call destroy() when it's shutting down, but if it decides to take the servlet out of service for any other reasons, it will also call the method.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Pubudu Fernando
Greenhorn

Joined: Oct 12, 2011
Posts: 5
wow.. that was quick... thanks
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Servlet Life Cycle
 
Similar Threads
destroy method
Call destroy() inside init()
destroy() method effect
destroy( ) method
When a Servlet destroy method is called.