@Override public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { wrapped.forward(request, response); }
/** * Default resource serving. * <p> * The default implementation of this method does nothing. * <p> * However, if the reserved portlet initialization parameter * {@link #AUTOMATIC_RESOURCE_DISPATCH} * (= "javax.portlet.automaticResourceDispatching") * is set to <code>true</code>, the default * implementation will perform a * <code>PortletRequestDispatcher.forward</code> to the location designated by * the ResourceID of the ResourceRequest. * If no ResourceID is set on the resource URL the default implementation * does nothing. * * @since 2.0 */ public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { String autofwd = getInitParameter(AUTOMATIC_RESOURCE_DISPATCH); if (autofwd != null && autofwd.equalsIgnoreCase("true")) { if (request.getResourceID() != null) { PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher( request.getResourceID()); if (rd != null) rd.forward(request, response); } } }
public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { getWrapped().forward(request, response); }
public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { getWrapped().forward(request, response); }
public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { getWrapped().forward(request, response); }
/** * Perform a dispatch on the given PortletRequestDispatcher. * <p>The default implementation uses a forward for resource requests * and an include for render requests. * @param dispatcher the PortletRequestDispatcher to use * @param request current portlet render/resource request * @param response current portlet render/resource response * @throws Exception if there's a problem performing the dispatch */ protected void doDispatch(PortletRequestDispatcher dispatcher, PortletRequest request, MimeResponse response) throws Exception { // In general, we prefer a forward for resource responses, in order to have full Servlet API // support in the target resource (e.g. on uPortal). However, on Liferay, a resource forward // displays an empty page, so we have to resort to an include there... if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) && !dispatcher.getClass().getName().startsWith("com.liferay")) { dispatcher.forward(request, response); } else { dispatcher.include(request, response); } }
/** {@inheritDoc} */ public void doForward(String path) throws IOException { if (responseDelegate.isResponseCommitted()) { doInclude(path); return; } try { PortletRequestDispatcher rd = getPortletContext() .getRequestDispatcher(path); if (rd == null) { throw new IOException( "No portlet request dispatcher returned for path '" + path + "'"); } rd.forward(request, response); } catch (PortletException e) { throw new IOException("PortletException while including path '" + path + "'.", e); } }
protected void dispatch(PortletRequestDispatcher dispatcher, PortletRequest request, PortletResponse response, boolean include) throws IOException, PortletException { request.setAttribute(ContainerConstants.HST_RESET_FILTER, Boolean.TRUE); try { if (include) { dispatcher.include(request, response); } else { dispatcher.forward(request, response); } } finally { request.removeAttribute(ContainerConstants.HST_RESET_FILTER); } } }
/** * Serve the resource as specified in the given request to the given response, * using the PortletContext's request dispatcher. * <p>This is roughly equivalent to Portlet 2.0 GenericPortlet. * @param request the current resource request * @param response the current resource response * @param context the current Portlet's PortletContext * @throws PortletException propagated from Portlet API's forward method * @throws IOException propagated from Portlet API's forward method */ public static void serveResource(ResourceRequest request, ResourceResponse response, PortletContext context) throws PortletException, IOException { String id = request.getResourceID(); if (id != null) { if (!PortletUtils.isProtectedResource(id)) { PortletRequestDispatcher rd = context.getRequestDispatcher(id); if (rd != null) { rd.forward(request, response); return; } } response.setProperty(ResourceResponse.HTTP_STATUS_CODE, "404"); } }
private boolean doNonFacesDispatch(RenderRequest request, RenderResponse response) throws PortletException { // Can only dispatch if the path is encoded in the request parameter String targetPath = request.getParameter(Bridge.NONFACES_TARGET_PATH_PARAMETER); if (targetPath == null) { // Didn't handle this request return false; } try { PortletRequestDispatcher dispatcher = this.getPortletContext().getRequestDispatcher(targetPath); dispatcher.forward(request, response); return true; } catch (Exception e) { throw new PortletException("Unable to dispatch to: " + targetPath, e); } }
@Override protected void doDispatch(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { String autoNonFacesViewDispatch = getInitParameter("javax.portlet.faces.automaticNonFacesViewDispatching"); String nonFacesTargetPath = renderRequest.getParameter(Bridge.NONFACES_TARGET_PATH_PARAMETER); if ((autoNonFacesViewDispatch != null) && autoNonFacesViewDispatch.equalsIgnoreCase("true") && (nonFacesTargetPath != null)) { PortletContext portletContext = getPortletContext(); String responseContentType = renderRequest.getResponseContentType(); // TCK TestPage017: requestProcessingNonFacesTest renderResponse.setContentType(responseContentType); PortletRequestDispatcher portletRequestDispatcher = portletContext.getRequestDispatcher(nonFacesTargetPath); try { portletRequestDispatcher.forward(renderRequest, renderResponse); } catch (Exception e) { e.printStackTrace(); } } else { super.doDispatch(renderRequest, renderResponse); } }
/** * Serve the resource as specified in the given request to the given response, * using the PortletContext's request dispatcher. * <p>This is roughly equivalent to Portlet 2.0 GenericPortlet. * @param request the current resource request * @param response the current resource response * @param context the current Portlet's PortletContext * @throws PortletException propagated from Portlet API's forward method * @throws IOException propagated from Portlet API's forward method */ public static void serveResource(ResourceRequest request, ResourceResponse response, PortletContext context) throws PortletException, IOException { String id = request.getResourceID(); if (id != null) { if (!PortletUtils.isProtectedResource(id)) { PortletRequestDispatcher rd = context.getRequestDispatcher(id); if (rd != null) { rd.forward(request, response); return; } } response.setProperty(ResourceResponse.HTTP_STATUS_CODE, "404"); } }
portletRequestDispatcher.forward(renderRequest, renderResponse);
/** * Default resource serving. * <p> * The default implementation of this method does nothing. * <p> * However, if the reserved portlet initialization parameter * {@link #AUTOMATIC_RESOURCE_DISPATCH} * (= "javax.portlet.automaticResourceDispatching") * is set to <code>true</code>, the default * implementation will perform a * <code>PortletRequestDispatcher.forward</code> to the location designated by * the ResourceID of the ResourceRequest. * If no ResourceID is set on the resource URL the default implementation * does nothing. * * @since 2.0 */ public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { String autofwd = getInitParameter(AUTOMATIC_RESOURCE_DISPATCH); if (autofwd != null && autofwd.equalsIgnoreCase("true")) { if (request.getResourceID() != null) { PortletRequestDispatcher rd = getPortletConfig().getPortletContext().getRequestDispatcher( request.getResourceID()); if (rd != null) rd.forward(request, response); } } }
if (hasRenderRedirectedAfterForward == null || !hasRenderRedirectedAfterForward.booleanValue()) prd.forward((PortletRequest) getRequest(), (PortletResponse) getResponse());
portletRequestDispacher.forward(portletRequest, portletResponse);
portletRequestDispacher.forward(portletRequest, portletResponse);
dispatcher.forward(request, response); } catch (Exception e) { throw new PortletException("Unable to perform non-faces dispatch to: " + nonFacesTargetPath, e);
@Override protected void doRender(View view, Map model, PortletRequest request, MimeResponse response) throws Exception { // Expose Portlet ApplicationContext to view objects. request.setAttribute( ViewRendererServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, getPortletApplicationContext()); // These attributes are required by the ViewRendererServlet. request.setAttribute(ViewRendererServlet.VIEW_ATTRIBUTE, view); request.setAttribute(ViewRendererServlet.MODEL_ATTRIBUTE, model); // Forward to the view in the resource response. if (PortletRequest.RESOURCE_PHASE.equals( request.getAttribute(PortletRequest.LIFECYCLE_PHASE))) { getPortletContext() .getRequestDispatcher(this.viewRendererUrl) .forward(request, response); } else { getPortletContext() .getRequestDispatcher(this.viewRendererUrl) .include(request, response); } } }
PortletRequestDispatcher rd = mPortletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(request, response); return;