I have a simple webapp deployed within Apache Tomcat (7.0.x) which is bootstrapped using a ContextLoaderListener instead of a Servlet. I would like this webapp to NOT auto-start whenever the Tomcat server itself is started but instead only started/stopped manually via the Tomcat manager. The examples I see online show how this can easily be done with the following code for servlets within web.xml:
<servlet><load-on-startup>0</load-on-startup></servlet>
But no examples are available for when using a ContextLoaderListener. Is this possible at all? Or would I need to include a servlet in order to configure the webapp to NOT auto-start whenever the Tomcat server itself is started?
Thanks in advance,
PM.
You should read this recent discussion on the Tomcat users’ list which I believe answers your exact question: http://markmail.org/message/5hp3dohwj3vncg4c
The bottom line is that you can start only the Manager webapp on startup, but there are some restrictions about what happens after a restart. The replies from Mark Thomas are the most useful.