Package javax.faces.context

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


            {
               String url = contextPath + builder.buildURL(mapping).encode()
                        + builder.buildQueryString(mapping).toString();
               log.trace("Redirecting to mappingId [" + mapping.getId() + "], [" + url + "]");
               String redirectUrl = externalContext.encodeRedirectURL(url, null);
               externalContext.redirect(redirectUrl);
            }
            else
            {
               throw new PrettyException("PrettyFaces: Invalid mapping id supplied to navigation handler: " + action);
            }
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

        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

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

            try
            {
                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

        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

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

            try
            {
                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

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

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.