On 26/08/2010 14:38, Chefo wrote: > Hi guys, > > I'm using tomcat 6.0.18 adapted to osgi environment and I would like to make > the WebappClassLoader configurable so that it does not load certain packages > directly through the system class loader but use the class loader hierarchy > instead. In order to do that I have extended the standard webapp class > > loader and configured the container to use the new one in the base > context.xml. I want to configure the packages through a context parameter > (separately for each webapp) or eventually through an env-entry. However I > cannot find a way to access the StandardContext instance in my > WebappClassLoader. This is probably a very simple thing to do but I'm not > really well familiar with catalina API and this is kinda driving me crazy. > Any help/suggestion is more than welcome.
The public parts, (and arguably some other bits), of WebappClassLoader are accessible to any code calling Thread.getContextClassLoader() with a simple cast. Simple access to the underlying StandardContext which circumvented the ServletContext interface would be a bit pointless & somewhat dangerous. Why do you need the StandardContext? p
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature