* @throws PortletException
* @throws IOException
*/
protected void executeRenderResult(final String finalLocation) throws PortletException, IOException {
LOG.debug("Executing result in Render phase");
PortletContext ctx = PortletActionContext.getPortletContext();
RenderRequest req = PortletActionContext.getRenderRequest();
RenderResponse res = PortletActionContext.getRenderResponse();
res.setContentType(contentType);
if (TextUtils.stringSet(title)) {
res.setTitle(title);
}
LOG.debug("Location: " + finalLocation);
if (useDispatcherServlet) {
req.setAttribute(DISPATCH_TO, finalLocation);
PortletRequestDispatcher dispatcher = ctx.getNamedDispatcher(dispatcherServletName);
if(dispatcher == null) {
throw new PortletException("Could not locate dispatcher servlet \"" + dispatcherServletName + "\". Please configure it in your web.xml file");
}
dispatcher.include(req, res);
} else {
PortletRequestDispatcher dispatcher = ctx.getRequestDispatcher(finalLocation);
if (dispatcher == null) {
throw new PortletException("Could not locate dispatcher for '" + finalLocation + "'");
}
dispatcher.include(req, res);
}