Package javax.faces.application

Examples of javax.faces.application.NavigationHandler


            ExceptionQueuedEvent event = it.next();
            ExceptionQueuedEventContext eqec = event.getContext();
           
            if(eqec.getException() instanceof ViewExpiredException) {
                FacesContext context = eqec.getContext();
                NavigationHandler navHandler = context.getApplication().getNavigationHandler();
                try {
                    navHandler.handleNavigation(context, null, "welcome.jsf?faces-redirect=true&expired=true");
                }
                finally {
                    it.remove();
                }
            }
View Full Code Here


            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();

            Throwable t = context.getException();

            final FacesContext fc = FacesContext.getCurrentInstance();
            final NavigationHandler nav = fc.getApplication().getNavigationHandler();

            try {

                // change exception for different jpa provider as this is what
                // hibernate throws in case of optimistic lock failure.
                if (unwindException(t) instanceof StaleObjectStateException) {
                    FacesUtils.error("error.optimisticLocking");
                    nav.handleNavigation(fc, null, null);
                    fc.renderResponse();

                } else if (t instanceof ViewExpiredException) {

                    FacesUtils.error("error.sessionExpired");
                    nav.handleNavigation(fc, null, "/login.xhtml");
                    fc.renderResponse();

                }

            } finally {
View Full Code Here

            ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();

            Throwable t = context.getException();

            final FacesContext fc = FacesContext.getCurrentInstance();
            final NavigationHandler nav = fc.getApplication().getNavigationHandler();

            try {

                // change exception for different jpa provider as this is what
                // hibernate throws in case of optimistic lock failure.
                if (unwindException(t) instanceof StaleObjectStateException) {
                    FacesUtils.error("error.optimisticLocking");
                    nav.handleNavigation(fc, null, null);
                    fc.renderResponse();

                } else if (t instanceof ViewExpiredException) {

                    FacesUtils.error("error.sessionExpired");
                    nav.handleNavigation(fc, null, "/login.xhtml");
                    fc.renderResponse();

                }

            } finally {
View Full Code Here

            FacesContext facesContext, UIOutcomeTarget component) throws IOException {
        String outcome = component.getOutcome();
        outcome = ((outcome == null) ? STR_EMPTY : outcome.trim());

        // Get the correct URL for the outcome.
        NavigationHandler nh = facesContext.getApplication().getNavigationHandler();
        if (!(nh instanceof ConfigurableNavigationHandler)) {
            throw new FacesException("Navigation handler must be an instance of " +
                    "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
View Full Code Here

      UIComponent source = event.getComponent();
      ActionSource actionSource = (ActionSource) source;
      Application application = facesContext.getApplication();
      MethodBinding binding = actionSource.getAction();
      // Retrieve the NavigationHandler instance..
      NavigationHandler navHandler = application.getNavigationHandler();
      // Invoke nav handling..
      String navBinding =
          (null != binding) ? binding.getExpressionString() : null;
      navHandler.handleNavigation(facesContext, navBinding,
          errorOutcome);
      // Trigger a switch to Render Response if needed
      facesContext.renderResponse();
    }
  }
View Full Code Here

            FacesContext facesContext, UIOutcomeTarget component) throws IOException {
        String outcome = component.getOutcome();
        outcome = ((outcome == null) ? STR_EMPTY : outcome.trim());

        // Get the correct URL for the outcome.
        NavigationHandler nh = facesContext.getApplication().getNavigationHandler();
        if (!(nh instanceof ConfigurableNavigationHandler)) {
            throw new FacesException("Navigation handler must be an instance of " +
                    "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
View Full Code Here

        String outcome = component.getOutcome();
        outcome = (outcome == null) ? facesContext.getViewRoot().getViewId() : outcome;
        outcome = ((outcome == null) ? STR_EMPTY : outcome.trim());

        // Get the correct URL for the outcome.
        NavigationHandler nh = facesContext.getApplication().getNavigationHandler();
        if (!(nh instanceof ConfigurableNavigationHandler)) {
            throw new FacesException("Navigation handler must be an instance of " +
                    "ConfigurableNavigationHandler for using h:link or h:button");
        }
        ConfigurableNavigationHandler navigationHandler = (ConfigurableNavigationHandler) nh;
View Full Code Here

            flowsWithId = new CopyOnWriteArrayList<Flow>();
            flowsByFlowId.put(id, flowsWithId);
        }
        flowsWithId.add(toAdd);
       
        NavigationHandler navigationHandler = context.getApplication().getNavigationHandler();
        if (navigationHandler instanceof ConfigurableNavigationHandler) {
            ((ConfigurableNavigationHandler)navigationHandler).inspectFlow(context, toAdd);
        }
        flowFeatureIsEnabled = true;
    }
View Full Code Here

            }
        }

        // Retrieve the NavigationHandler instance..

        NavigationHandler navHandler = application.getNavigationHandler();

        // Invoke nav handling..

        navHandler.handleNavigation(context,
                                    (null != binding) ?
                                    binding.getExpressionString() : null,
                                    outcome);

        // Trigger a switch to Render Response if needed
View Full Code Here

        String outcome = component.getOutcome();
        outcome = (outcome == null) ? facesContext.getViewRoot().getViewId()
                : outcome;
        outcome = ((outcome == null) ? STR_EMPTY : outcome.trim());
        // Get the correct URL for the outcome.
        NavigationHandler nh = facesContext.getApplication().getNavigationHandler();
        if (!(nh instanceof ConfigurableNavigationHandler))
        {
            throw new FacesException(
                    "Navigation handler must be an instance of "
                            + "ConfigurableNavigationHandler for using h:link or h:button");
View Full Code Here

TOP

Related Classes of javax.faces.application.NavigationHandler

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.