Package javax.faces.context

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


               
                // 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


               
                // 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

        return true;
      }

      if (!externalContext.getRequestServletPath().endsWith("/")) {
        try {
          externalContext.redirect(externalContext.getRequestServletPath() + "/");
          facesContext.responseComplete();
          return true;
        } catch (IOException e) {
          throw new FacesException("redirect failed", e);
        }
View Full Code Here

      }
      // TODO: PortletRequest ??
    }
    String forward = externalContext.getRequestContextPath() + "/";
    try {
      externalContext.redirect(forward);
    } catch (IOException e) {
      LOG.error("", e);
      // TODO: may do error handling
      throw new FacesException("Can't redirect to '" + forward + "'");
    }
View Full Code Here

    if (!BooleanUtils.toBoolean(loggedIn)) {
      try {
        externalContext.getSessionMap().put(LOGGED_IN, Boolean.TRUE);
        String forward = externalContext.getRequestContextPath() + "/faces/addressbook/start.xhtml";
        externalContext.redirect(externalContext.encodeResourceURL(forward));
      } catch (Exception e) {
        LOG.error("", e);
        String forward = externalContext.getRequestContextPath() + "/error.xhtml";
        try {
          externalContext.redirect(externalContext.encodeResourceURL(forward));
View Full Code Here

        externalContext.redirect(externalContext.encodeResourceURL(forward));
      } catch (Exception e) {
        LOG.error("", e);
        String forward = externalContext.getRequestContextPath() + "/error.xhtml";
        try {
          externalContext.redirect(externalContext.encodeResourceURL(forward));
        } catch (IOException e2) {
          LOG.error("", e2);
          throw new FacesException("Can't redirect to errorpage '" + forward + "'");
        }
      }
View Full Code Here

        return true;
      }

      if (!externalContext.getRequestServletPath().endsWith("/")) {
        try {
          externalContext.redirect(externalContext.getRequestServletPath() + "/");
          facesContext.responseComplete();
          return true;
        } catch (IOException e) {
          throw new FacesException("redirect failed", e);
        }
View Full Code Here

      }
      // TODO: PortletRequest ??
    }
    String forward = externalContext.getRequestContextPath() + "/";
    try {
      externalContext.redirect(forward);
    } catch (IOException e) {
      LOG.error("", e);
      // TODO: may do error handling
      throw new FacesException("Can't redirect to '" + forward + "'");
    }
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

            }

            if (viewId == null) {
                if (!externalContext.getRequestServletPath().endsWith("/")) {
                    try {
                        externalContext.redirect(externalContext
                                .getRequestServletPath()
                                + "/");
                        facesContext.responseComplete();
                        return true;
                    } catch (IOException e) {
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.