Your application may be on a shared Tomcat instance someday and System.exit is really bad in that case.
True. So let's kill the servlet instead. But it's still unclear how you'd do that because from the ServletConfig you can get the ServletContext but from the ServletContext you can no longer get the Servlet: that has been deprecated and that getter now returns null. But perhaps I am looking in the wrong direction: the Servlet.destroy APIdoc says "Called by the servlet container to indicate to a servlet that the servlet is being taken out of service." which implies that the teardown is initiated elsewhere and that simply calling destroy wouldn't do anything useful.
If you really do want to control Tomcat startup, a LifecycleListener
> is a better approach but Tomcat specific. There are plenty of LifecycleListener classes in the API; which one would work best: ServerLifecycleListener? -- O.L. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org