log.error(message);
throw new PortletException();
}
Portlet portlet = null;
try
{
ClassLoader loader = (ClassLoader)classLoaders.get(portletApplicationName);
if (null == loader)
{
StringBuffer localPath = new StringBuffer("file:");
localPath.append(jetspeedContext.getRealPath(JetspeedPortletContext.LOCAL_PA_ROOT));
localPath.append(portletApplicationName);
String localAppPath = localPath.toString();
URL[] urls = {new URL(localAppPath + LOCAL_CLASSES),
new URL(localAppPath + LOCAL_JARS)};
loader = new URLClassLoader(urls, oldLoader);
classLoaders.put(portletApplicationName, loader);
}
Thread.currentThread().setContextClassLoader(loader);
portlet = JetspeedPortletFactoryProxy.getPortlet(jetspeedConfig, portletDefinition);
}
catch (Exception e)
{
e.printStackTrace();
return;
}
if (method == ContainerConstants.METHOD_NOOP)
{
return;
}
//res.getWriter().print("Rendering: Portlet Class = " + entity.getPortletClass() + "<BR/>");
if (method == ContainerConstants.METHOD_ACTION)
{
ActionRequest actionRequest = (ActionRequest)portletRequest;
ActionResponse actionResponse = (ActionResponse)portletResponse;
portlet.processAction(actionRequest, actionResponse);
}
else if (method == ContainerConstants.METHOD_RENDER)
{
RenderRequest renderRequest = (RenderRequest)portletRequest;
RenderResponse renderResponse = (RenderResponse)portletResponse;
renderResponse.setContentType("text/html");
renderResponse.getWriter().print(portletDefinition.getName());
portlet.render(renderRequest, renderResponse);
}
Thread.currentThread().setContextClassLoader(oldLoader);
}