PortletRequestContextService rcService = getContainerServices().getPortletRequestContextService();
PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
PortletInvokerService invoker = getContainerServices().getPortletInvokerService();
PortletRequestContext requestContext = rcService.getPortletRenderRequestContext(this, request, response, portletWindow);
PortletRenderResponseContext responseContext = rcService.getPortletRenderResponseContext(this, request, response, portletWindow);
RenderRequest portletRequest = envService.createRenderRequest(requestContext, responseContext);
RenderResponse portletResponse = envService.createRenderResponse(responseContext);
FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.RENDER_PHASE);
try
{
invoker.render(requestContext, portletRequest, portletResponse, filterManager);
// Mark portlet interaction is completed: backend implementation can flush response state now
responseContext.close();
}
finally
{
responseContext.release();
}
debugWithName("Portlet render done for: " + portletWindow.getPortletDefinition().getPortletName());
}