Hello folks,
I would like introduce new & very simple extension of Tomcat.
In my opinion, many people must have solved situation when some extra
configurations or classes must be loaded into application that can't be
part of WAR file.
Applications servers (WAS for example.) has concept of configurable
shared libs. In Tomcat concept like this is missing.
So I think that would be very nice have possibility have some way how to
do it.
Mine suggestion is to create new class loader (or extend current
implementation of WebappClassLoader).
Simple solution can extend set of repositories in implicit manner.
If context is defined, let say CONTEXT,
and directory CATALINA_HOME/webappsLib/[CONTEXT]/lib or directory
CATALINA/webappsLib/[CONTEXT]/classes exists, then classloader append
this entries to repositories.
More advanced strategy can be used for that, but as first step is this
relatively good solution.
Please let me know your opinion.
I have code ready. It is separate implementation, so one must extends
context.xml like this:
Context>
<Loader loaderClass="org.apache.catalina.loader.WebappClassLoaderExt"/>
...
best regards
Juraj Burian