Hello Wicket Developers,
Thanks for a great framework. I am studying the source code for Wicket and
have some questions about some parts of the code that are not obvious to me.
I have spent many hours stepping through the code and have not found a good
answer/reason.
1) in the WicketFilter init() and doGet() method wicket is getting the
current class loader twice and checking if the previousClassLoader is the
same as the current class loader. Why is this code needed and what does it
really do? Are you fixing some bug in some app server with this code?
final ClassLoader previousClassLoader =
Thread.currentThread().getContextClassLoader();
final ClassLoader newClassLoader = getClassLoader();
try
{
if (previousClassLoader != newClassLoader)
{
Thread.currentThread().setContextClassLoader(newClassLoader);
}
protected ClassLoader getClassLoader()
{
return Thread.currentThread().getContextClassLoader();
}
Thanks
Adib