Package javax.faces.context

Examples of javax.faces.context.ExternalContext.redirect()


            try
            {
                //there are no jsf2 view-params, but codi view-config params should be added (if present)
                redirectPath = JsfUtils.addParameters(externalContext, redirectPath, false, true, true);
                externalContext.redirect(externalContext.encodeActionURL(redirectPath));
            }
            catch (IOException e)
            {
                throw new FacesException(e.getMessage(), e);
            }
View Full Code Here


       */
      extCtx.getRequestMap().put("myRedirectRequestObject", Boolean.TRUE);
      String target = ctx.getApplication().getViewHandler().getActionURL(ctx, "/tests/RedirectTestResultRenderCheck.jsp");
      try
      {
        extCtx.redirect(target);
      }
      catch (Exception e)
      {
        testRunner.setTestResult(false,
                                 "Calling extCtx.redirect() threw an exception: " + e.getMessage());
View Full Code Here

    if (viewId.equals("/tests/SingleRequestTest.jsp"))
    {
      String target = ctx.getApplication().getViewHandler().getActionURL(ctx, "/tests/RedirectTestResultRenderCheck.jsp");
      try
      {
        extCtx.redirect(target);
      }
      catch (Exception e)
      {
        testRunner.setTestComplete(true);
        testRunner.setTestResult(false,
View Full Code Here

    String viewId = ctx.getViewRoot().getViewId();
    if (viewId.equals("/tests/SingleRequestTest.jsp"))
    {
      try
      {
        extCtx.redirect("/tests/NonJSFView.portlet");
      }
      catch (IllegalStateException i)
      {
        testRunner.setTestResult(true,
                               "extCtx.redirect() during render correctly threw the IllegalStateException when redirecting to a nonFaces view.");
View Full Code Here

      {
        // issue the redirect
        ViewHandler viewHandler = ctx.getApplication().getViewHandler();
        try
        {
          extCtx.redirect(viewHandler.getActionURL(ctx, "/tests/RedisplayRenderRequestTest.jsp"));
        }
        catch (IOException e)
        {
          testRunner.setTestComplete(true);
          testRunner.setTestResult(false,
View Full Code Here

                ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
                String redirectPath = viewHandler.getActionURL(facesContext, navigationCase.getToViewId());

                try
                {
                    externalContext.redirect(externalContext.encodeActionURL(redirectPath));
                }
                catch (IOException e)
                {
                    throw new FacesException(e.getMessage(), e);
                }
View Full Code Here

    HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
    if (session != null) {
      session.invalidate();
    }
    ExternalContext externalContext = facesContext.getExternalContext();
    externalContext.redirect("/" + externalContext.getRequestContextPath());
    facesContext.responseComplete();
    return null;
  }

  public TabChangeListener getTabChangeListener() {
View Full Code Here

            try
            {
                //there are no jsf2 view-params, but codi view-config params should be added (if present)
                redirectPath = JsfUtils.addParameters(externalContext, redirectPath, false, true, true);
                externalContext.redirect(externalContext.encodeActionURL(redirectPath));
            }
            catch (IOException e)
            {
                throw new FacesException(e.getMessage(), e);
            }
View Full Code Here

               
                // JSF 2.0 Spec call Flash.setRedirect(true) to notify Flash scope and take proper actions
                externalContext.getFlash().setRedirect(true);
                try
                {
                    externalContext.redirect(redirectPath);
                    facesContext.responseComplete();
                }
                catch (IOException e)
                {
                    throw new FacesException(e.getMessage(), e);
View Full Code Here

      {
        // issue the redirect
        ViewHandler viewHandler = ctx.getApplication().getViewHandler();
        try
        {
          extCtx.redirect(viewHandler.getActionURL(ctx, "/tests/RedisplayRenderRequestTest.jsp"));
        }
        catch (IOException e)
        {
          testRunner.setTestComplete(true);
          testRunner.setTestResult(false,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.