tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How to call an external class from a webapp (i.e. - implement a plugin)
Date Wed, 07 Jul 2010 20:25:22 GMT
Hash: SHA1


On 7/7/2010 3:48 PM, Caldarale, Charles R wrote:
>> From: Christopher Schultz [] 
>> Subject: Re: How to call an external class from a webapp (i.e. - 
>> implement a plugin)
>> Another option is to implement your own ClassLoader that scans a
>> directory (such as /my/great/plugins) for JAR files and will load
>> them alongside your webapp's classes.
> Tomcat already has a form of this capability: 
> org.apache.catalina.loader.VirtualWebappLoader
> If you declare this in the className attribute of a <Loader> element
> nested inside the <Context> of interest, you can specify additional
> directories to search for class references.  It exists in all
> supported Tomcat levels, but is only documented in Tomcat 7:

Good to know. I didn't know it was available before TC 7.0 or without
compiling it yourself... I did know that it existed, at least somewhere.

I would tend to favor a ClassLoader that was explicitly used for only
plug-in class loading. I thought you could set a SecurityManager on a
ClassLoader, but my mind must be remembering something else, 'cause it
certainly not in the documentation. :(

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message