I have several mini wars that are modules of a larger application running on a Tomcat 6.0 server. I’m doing it this way, instead of putting all modules in one war, because different installations need different modules. I’m starting to hit a roadblock in which I need to know what other mini wars are installed in the server. Is there a way to get the list of all installed wars/contexts in the Tomcat 6.0 server?
Share
I’ve managed to get a workaround to this problem since the “mini wars” that I will create can share a lib at the common class loader level in tomcat. The trick would be to use an
ApplicationListener(located in the common class loader) that does the following:When a
Contextis created it registers as aServletContextin the static map. This static map is then shared between all contexts through theContextvariablemyapps. Anytime I need access to other contexts I can do the following:Hope it helps somebody.