Package javax.faces.application

Examples of javax.faces.application.NavigationHandler


        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


            {
                throw new FacesException("Error calling action method of component with id " + actionEvent.getComponent().getClientId(facesContext), e);
            }
        }

        NavigationHandler navigationHandler = application.getNavigationHandler();
        navigationHandler.handleNavigation(facesContext,
                                           fromAction,
                                           outcome);
    //Render Response if needed
    facesContext.renderResponse();
View Full Code Here

                outcome = objOutcome.toString();
            }

        }
       
        NavigationHandler navigationHandler = application.getNavigationHandler();
        navigationHandler.handleNavigation(facesContext, fromAction, outcome);
        //Render Response if needed
        facesContext.renderResponse();

    }
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

   * or <code>null</code> if none
   */
  protected final void callNextHandlerInChain(
      FacesContext facesContext, String fromAction, String outcome, NavigationHandler originalNavigationHandler) {

    NavigationHandler decoratedNavigationHandler = getDecoratedNavigationHandler();

    if (decoratedNavigationHandler instanceof DecoratingNavigationHandler) {
      // DecoratingNavigationHandler specified through constructor argument:
      // Call it with original NavigationHandler passed in.
      DecoratingNavigationHandler decHandler = (DecoratingNavigationHandler) decoratedNavigationHandler;
      decHandler.handleNavigation(facesContext, fromAction, outcome, originalNavigationHandler);
    }
    else if (decoratedNavigationHandler != null) {
      // Standard NavigationHandler specified through constructor argument:
      // Call it through standard API, without original NavigationHandler passed in.
      // The called handler will not be able to redirect to the original handler.
      decoratedNavigationHandler.handleNavigation(facesContext, fromAction, outcome);
    }
    else if (originalNavigationHandler != null) {
      // No NavigationHandler specified through constructor argument:
      // Call original handler, marking the end of this chain.
      originalNavigationHandler.handleNavigation(facesContext, fromAction, outcome);
View Full Code Here

   * as argument will be used. Else, the standard <code>handleNavigation</code>
   * method will be called.
   */
  @Override
  public void handleNavigation(FacesContext facesContext, String fromAction, String outcome) {
    NavigationHandler handler = getDelegate(facesContext);
    if (handler instanceof DecoratingNavigationHandler) {
      ((DecoratingNavigationHandler) handler).handleNavigation(
          facesContext, fromAction, outcome, this.originalNavigationHandler);
    }
    else {
      handler.handleNavigation(facesContext, fromAction, outcome);
    }
  }
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

        return;
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("outcome = '" + outcome + "'");
    }
    NavigationHandler navigationHandler = application.getNavigationHandler();
    navigationHandler.handleNavigation(facesContext, null, outcome);
    lifecycle.render(facesContext);
  }
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

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.