Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to handle undeploy event

 
Veera Sundar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Is there any way to call a function, when my web application is undeployed from Tomcat?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the web app is running at the time you can work with Servlet.destroy for servlets, and more generally with ServletContext.contextDestroyed.

If the web app is not running, then there is no code to call...
 
Veera Sundar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information Ulf... Very useful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic