I implement a custom ServletContextListener
and place the breakpoints on both the contextInitialized()
and contextDestroyed()
.
W
The contextDestroyed()
will only be called when you gracefully shuts down the server by opening the Servers view and rightclicking the server instance and choosing Stop, or by hitting the red button in the Servers view whose tooltip says Stop the server.
It will not be called when you terminate the server altogether by hitting the red button in the Console view whose tooltip says Terminate. Terminating (killing) is not the same as stopping.