tags:

views:

203

answers:

2

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
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:

which seem to cover this in Tomcat 5.5, but should work with 6 as well.

StaxMan