File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt on Servlets

 
janardhan rao B
Greenhorn
Posts: 9
Chrome Eclipse IDE Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic