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 Servlets and the fly likes Doubt on Servlets 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 » Java » Servlets
Bookmark "Doubt on Servlets" Watch "Doubt on Servlets" New topic
Author

Doubt on Servlets

janardhan rao B
Greenhorn

Joined: May 27, 2010
Posts: 9

hi, this is janardhan and i am a junior java developer.
can any one please give me answer for the below...
what is the purpose of destroy( ) method , when it will call, who will call and what are the cases or reasons for calling this method in a servlet ?


Success is nothing more than a few simple disciplines, practiced every day.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
The servlet container calls the destroy method when it is about to take the servlet out of service.

Just like it says in the javax.servlet.destroy() documentation. If the programmer has created some resource that should be cleaned up - for example flushing and closing a file, this is your last chance to do it.

When this point is covered is all discussions of the servlet life cycle, why did you find it necessary to ask here?

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Doubt on Servlets
 
Similar Threads
how to refresh the dispaly in Swing
thread doubt??
what is call stacks method?
How to call a method in the supermost class
Is it possible to use: RequestDispatcher view =request.getRequestDispatcher("ProcessPlease.java")