{
HttpServletRequest dreq = invocation.getDispatchedRequest();
//
PortletRequestImpl req;
PortletResponseImpl resp;
String phase;
FilterChainImpl<?> chain;
if (invocation instanceof ActionInvocation)
{
req = new ActionRequestImpl(this, (ActionInvocation)invocation);
resp = new ActionResponseImpl((ActionInvocation)invocation, req);
phase = PortletRequest.ACTION_PHASE;
chain = new FilterChainImpl<ActionFilter>(actionFilterList, ActionFilter.class);
}
else if (invocation instanceof RenderInvocation)
{
req = new RenderRequestImpl(this, (RenderInvocation)invocation);
resp = new RenderResponseImpl((RenderInvocation)invocation, req);
phase = PortletRequest.RENDER_PHASE;
chain = new FilterChainImpl<RenderFilter>(renderFilterList, RenderFilter.class);
}
else if (invocation instanceof EventInvocation)
{
req = new EventRequestImpl(this, (EventInvocation)invocation);
resp = new EventResponseImpl((EventInvocation)invocation, req);
phase = PortletRequest.EVENT_PHASE;
chain = new FilterChainImpl<EventFilter>(eventFilterList, EventFilter.class);
}
else if (invocation instanceof ResourceInvocation)
{
req = new ResourceRequestImpl(this, (ResourceInvocation)invocation);
resp = new ResourceResponseImpl((ResourceInvocation)invocation, req);
phase = PortletRequest.RESOURCE_PHASE;
chain = new FilterChainImpl<ResourceFilter>(resourceFilterList, ResourceFilter.class);
}
else
{
throw new InvocationException("Unexpected invocation " + invocation);
}
//
try
{
dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_INVOCATION, invocation);
dreq.setAttribute(Constants.JAVAX_PORTLET_CONFIG, config);
dreq.setAttribute(Constants.JAVAX_PORTLET_REQUEST, req);
dreq.setAttribute(Constants.JAVAX_PORTLET_RESPONSE, resp);
dreq.setAttribute(Constants.JAVAX_PORTLET_LIFECYCLE_PHASE, phase);
//
chain.doFilter(req, resp);
//
return resp.getResponse();
}
catch (NoClassDefFoundError e)
{
//
return new ErrorResponse(e);