简体   繁体   中英

Stop processes/threads before undeploying/stop application from Apache Tomcat

It is possibly programmatically to know when the web application is undeployed/stopped from Tomcat, in Java? I need to stop some processes running, but without setting up Tomcat, only Java code?

Yes. Use ServletContextListener . It will notify you when context is created and/or destroyed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM