Created
February 22, 2012 17:45
-
-
Save ghsyeung/1886275 to your computer and use it in GitHub Desktop.
Webapp clean-up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShutdownListener implements ServletContextListener { | |
@Override | |
public void contextDestroyed(ServletContextEvent sce) { | |
ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext()); | |
P p = (P) ctx.getBean("proc"); | |
p.shutdown(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<listener> | |
<listener-class>com.example.html.events.ShutdownListener</listener-class> | |
</listener> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment