Refine search
protected void include( ResourceRequest resourceRequest, ResourceResponse resourceResponse, String jspPath) throws IOException, PortletException { PortletConfig portletConfig = getPortletConfig(resourceRequest); PortletContext portletContext = portletConfig.getPortletContext(); PortletRequestDispatcher portletRequestDispatcher = portletContext.getRequestDispatcher(jspPath); portletRequestDispatcher.include(resourceRequest, resourceResponse); }
/** * 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); } } }
@Override public void include(RenderRequest request, RenderResponse response) throws PortletException, IOException { wrapped.include(request, response); }
PortletRequestDispatcher portletRequestDispacher = portletContext.getRequestDispatcher(path); portletRequestDispacher.include(portletRequest, portletResponse); portletRequestDispacher.include(portletRequest, portletResponse); portletRequestDispacher.forward(portletRequest, portletResponse);
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); } } }
/** * */ private void prepareServletActionContext() throws PortletException, IOException { PortletRequestDispatcher disp = PortletActionContext.getPortletConfig() .getPortletContext().getNamedDispatcher("preparator"); disp.include(PortletActionContext.getRenderRequest(), PortletActionContext.getRenderResponse()); } }
@Override public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { wrapped.forward(request, response); }
@Override public void include(PortletRequest request, PortletResponse response) throws PortletException, IOException { wrapped.include(request, response); }
PortletRequestDispatcher portletRequestDispacher = portletContext.getRequestDispatcher(path); portletRequestDispacher.include(portletRequest, portletResponse); portletRequestDispacher.include(portletRequest, portletResponse); portletRequestDispacher.forward(portletRequest, portletResponse);
/** * 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); } }
/** * */ private void prepareServletActionContext() throws PortletException, IOException { PortletRequestDispatcher disp = PortletActionContext.getPortletConfig() .getPortletContext().getNamedDispatcher("preparator"); disp.include(PortletActionContext.getRenderRequest(), PortletActionContext.getRenderResponse()); }
public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { getWrapped().forward(request, response); }
protected void include( String path, PortletRequest portletRequest, PortletResponse portletResponse, String lifecycle) throws IOException, PortletException { HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(portletRequest); PortletContext portletContext = (PortletContext)httpServletRequest.getAttribute( MVCRenderConstants. PORTLET_CONTEXT_OVERRIDE_REQUEST_ATTIBUTE_NAME_PREFIX + path); if (portletContext == null) { portletContext = getPortletContext(); } PortletRequestDispatcher portletRequestDispatcher = portletContext.getRequestDispatcher(path); if (portletRequestDispatcher == null) { _log.error(path + " is not a valid include"); } else { checkPath(path); portletRequestDispatcher.include(portletRequest, portletResponse); } if (clearRequestParameters) { if (lifecycle.equals(PortletRequest.RENDER_PHASE)) { portletResponse.setProperty( "clear-request-parameters", Boolean.TRUE.toString()); } } }
public void doView(RenderRequest req, RenderResponse res) throws IOException, PortletException { PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/view.jsp"); prd.include(req, res); }
@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); } } }
/** {@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); } }
public void forward(PortletRequest request, PortletResponse response) throws PortletException, IOException { getWrapped().forward(request, response); }
public void dispatch(String path) throws IOException { if (isActionRequest) { throw new IllegalStateException( "Cannot call dispatch(String) if the reqeust is ActionRequest."); } PortletRequestDispatcher requestDispatcher = portletContext .getRequestDispatcher(path); try { requestDispatcher.include((RenderRequest) portletRequest, (RenderResponse) portletResponse); } catch (PortletException e) { throw new FacesException( "Failed to include the content of a resource in the response.", e); } }
@Override protected void doHelp(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { helpView.include(renderRequest, renderResponse); }
PortletRequestDispatcher prd = mPortletContext.getRequestDispatcher(requestURI); if (hasRenderRedirectedAfterForward == null || !hasRenderRedirectedAfterForward.booleanValue()) prd.forward((PortletRequest) getRequest(), (PortletResponse) getResponse()); prd.include((PortletRequest) getRequest(), (PortletResponse) getResponse());