Package javax.faces.context

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


        // see #729
        addRequestWindowIdCookie(facesContext, newWindowId);

        try
        {
            externalContext.redirect(url);
        }
        catch (IOException e)
        {
            throw new FacesException("Could not send initial redirect!", 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

                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

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

       
        url = JsfUtils.addRequestParameters(externalContext, url, true);
       
        try
        {
            externalContext.redirect(url);
        }
        catch (IOException e)
        {
            throw new FacesException("Could not send initial redirect!", 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

        if(cmfContext.getCurrentUser() == null) {
            ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
            switch (CmfContext.getInstance().getSecurityType()) {
                case LOCAL:
                    try {
                        externalContext.redirect(loginUrl);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                    break;
View Full Code Here

                    // the container should prompt for authentication however the user has it set up
                    break;

                case CUSTOM:
                    try {
                        externalContext.redirect(cmfContext.getCustomLoginUrl());
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                    break;
            }
View Full Code Here

            QueryString query = prettyContext.getRequestQueryString();

            String target = contextPath + url.encode().toURL() + query.toQueryString();
            log.trace("Refreshing requested page [" + url + "]");
            String redirectUrl = externalContext.encodeRedirectURL(target, null);
            externalContext.redirect(redirectUrl);
            return true;
         }
         else if (isPrettyNavigationCase(prettyContext, action))
         {
            UrlMapping mapping = config.getMappingById(action);
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.