tags:

views:

84

answers:

2

Hi all,

I want to get an 'event' before tomcat stops my web application. My application needs to "wrap up" staff before it is being closed.

Any hint?

-- Yonatan

+1  A: 

You can write a ContextListener that responds to deploy/undeploy events. Maybe you can have it sends an email when the context is undeployed.

I'm just not sure if that event is fired if the app server is stopped.

duffymo
A: 

I think I found it, I created a servlet and implemented the

public void destory();

I verified that this method is invoked when I stop the application from the tomcat admin page, and even when I shut-down tomcat server

Yonatan Maman