Woodchuck wrote:
hihi all,

which class/function do i need to extend/override so that i can
absolutely guarantee that code is executed before the web app is
killed?  ie. if someone stops Tomcat or stops my Struts web app
instance, and i want to execute some code before it really goes down.


The way I do it is to extend the o.a.s.action.ActionServlet class and set it up to be the main servlet in web.xml using something like:


<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.mysite.ExtendedActionServlet</servlet-class>

<load-on-startup>1</load-on-startup>
</servlet>


And then override ActionServlet's destroy() method to take care of anything you need done when the site is shut down. Make sure you call super.destroy in it though :)




Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to