Package javax.portlet

Examples of javax.portlet.PortletRequestDispatcher


        Mock mockRd = mock(PortletRequestDispatcher.class);
        Mock mockPrep = mock(PortletRequestDispatcher.class);
       
        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();
        ActionInvocation inv = (ActionInvocation)mockInvocation.proxy();
       
        Constraint[] params = new Constraint[]{same(req), same(res)};
View Full Code Here


        Mock mockRd = mock(PortletRequestDispatcher.class);
        Mock mockPrep = mock(PortletRequestDispatcher.class);
       
        RenderRequest req = (RenderRequest)mockRequest.proxy();
        RenderResponse res = (RenderResponse)mockResponse.proxy();
        PortletRequestDispatcher rd = (PortletRequestDispatcher)mockRd.proxy();
        PortletConfig cfg = (PortletConfig)mockConfig.proxy();
        PortletContext ctx = (PortletContext)mockCtx.proxy();
       
        Constraint[] params = new Constraint[]{same(req), same(res)};
        mockRd.expects(once()).method("include").with(params);
View Full Code Here

  }
  public int getMinorVersion() {
    return _ctx.getMinorVersion();
  }
  public RequestDispatcher getNamedDispatcher(String name) {
    final PortletRequestDispatcher prd = _ctx.getNamedDispatcher(name);
    return prd != null ? PortletServletDispatcher.getInstance(prd): null;
  }
View Full Code Here

  }
  public String getRealPath(String path) {
    return _ctx.getRealPath(path);
  }
  public RequestDispatcher getRequestDispatcher(String path) {
    final PortletRequestDispatcher prd = _ctx.getRequestDispatcher(path);
    return prd != null ? PortletServletDispatcher.getInstance(prd): null;
  }
View Full Code Here

   */
  public static final
  void include(PortletContext ctx, RenderRequest request,
  RenderResponse response, String uri, Map params, int mode)
  throws IOException, PortletException {
    final PortletRequestDispatcher disp =
      getRequestDispatcher(ctx, uri, params, mode);
    if (disp == null)
      throw new PortletException("No dispatcher available to include "+uri);
    disp.include(request, response);
  }
View Full Code Here

      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");
    }
View Full Code Here

        }
      }
    }
    else
    {
      PortletRequestDispatcher rd = null;
      String previousURL = null;
      while (true)
      {
        rd = getPortletContext().getRequestDispatcher(wicketURL);
        if (rd != null)
        {
          rd.include((RenderRequest)request, (RenderResponse)response);
          String redirectLocation = responseState.getRedirectLocation();
          if (redirectLocation != null)
          {
            redirectLocation = fixWicketUrl(redirectLocation, wicketFilterPath,
              wicketFilterQuery);
View Full Code Here

    {
      response.setContentType(request.getResponseContentType());
    }
    try
    {
      PortletRequestDispatcher dispatcher =
        this.getPortletContext().getRequestDispatcher(targetPath);
      dispatcher.include(request, response);
      return true;
    } catch (Exception e)
    {
      throw new PortletException("Unable to dispatch to: " + targetPath, e);
    }
View Full Code Here

    if (getPortletPhase() == Bridge.PortletPhase.ACTION_PHASE)
    {
      throw new IllegalStateException("Request cannot be an ActionRequest");
    }

    PortletRequestDispatcher prd = mPortletContext.getRequestDispatcher(requestURI);

    if (prd == null)
    {
      throw new IllegalArgumentException("No request dispatcher can be created for the specified path: " +
                                         requestURI);
    }

    try
    {
      prd.include((RenderRequest) mOrigPortletRequest, (RenderResponse) mOrigPortletResponse);
    }
    catch (PortletException e)
    {
      if (e.getMessage() != null)
      {
View Full Code Here

    if (mPhase == Bridge.PortletPhase.ACTION_PHASE)
    {
      throw new IllegalStateException("Request cannot be an ActionRequest");
    }

    PortletRequestDispatcher prd = mPortletContext.getRequestDispatcher(requestURI);

    if (prd == null)
    {
      throw new IllegalArgumentException(
                                         "No request dispatcher can be created for the specified path: "
                                             + requestURI);
    }

    try
    {
      prd.include((RenderRequest) mOrigPortletRequest, (RenderResponse) mOrigPortletResponse);
    }
    catch (PortletException e)
    {
      if (e.getMessage() != null)
      {
View Full Code Here

TOP

Related Classes of javax.portlet.PortletRequestDispatcher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.