Hi,

In Sling, org.apache.sling.commons.classloader.impl.ClassLoaderFacade
is set as thread context classloader while activating
JspScriptEngineFactory.
The pseudo code is like following

ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(jspClassLoader)
try {

....
} finally {

Thread.currentThread().setContextClassLoader(oldClassLoader)

}

Why JSP processing needs to set thread context classloader explicitly?

Its problematic to use any framework (like CXF, or JAX-RPC stubs)
relying on thread context classloader from within OSGI components (and
therefore from sling servlets). Is above idiom a recommended way of
using these frameworks?

Thanks,
Unmesh

Reply via email to