Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Tomcat and the fly likes How to handle undeploy event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to handle undeploy event" Watch "How to handle undeploy event" New topic
Author

How to handle undeploy event

Veera Sundar
Greenhorn

Joined: Jun 08, 2007
Posts: 25
Hi All,

Is there any way to call a function, when my web application is undeployed from Tomcat?


Thanks,<br />Veera |<a href="http://veerasundar.com/blog" target="_blank" rel="nofollow">Blog</a>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
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...


Ping & DNS - my free Android networking tools app
Veera Sundar
Greenhorn

Joined: Jun 08, 2007
Posts: 25
Thanks for the information Ulf... Very useful.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to handle undeploy event
 
Similar Threads
Tomcat undeployment
error due to the following reason(s): Web mapping already exists
jsr 88: How to get an instance of DeployableObject
How to make AXIS start a class each time it starts?
How to reload an application.