I need to tweak some things inside Tomcat 6.0 before any web applications or listeners are started. What's the standard method for doing this? I can't do this from a web application or servlet init() since it is too late by the time it is loaded.
+2
A:
Creating a custom LifecycleListener is probably the right way of doing this. See the Tomcat configuration guide for more details; the lifecycle listeners can be added to most containers.
andri
2009-04-30 23:00:47
A:
You could run "embedded Tomcat", in which you fully control its setup, much like how Jetty is usually used.
Google pointed to following docs:
- [http://www.theserverside.com/discussions/thread.tss?thread_id=30625]
- [http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/startup/Embedded.html]
which seem to cover this in Tomcat 5.5, but should work with 6 as well.
StaxMan
2009-05-08 21:36:00