Package javax.faces.application

Examples of javax.faces.application.NavigationHandler.handleNavigation()


        assertEquals(_facesContext.getViewRoot().getViewId(), "/page3.jsp");

        // case 4: from-view-id = *, no from-outcome, with from-action
        viewRoot.setViewId("/anypage.jsp");
        _facesContext.setViewRoot(viewRoot);
        navigationHandler.handleNavigation(_facesContext, "#{action4}", "anyoutcome");
        assertEquals(_facesContext.getViewRoot().getViewId(), "/page4.jsp");

        // case 5: exact from-view-id match, with from-outcome, no from-action
        viewRoot.setViewId("/from5.jsp");
        _facesContext.setViewRoot(viewRoot);
View Full Code Here


        assertEquals(_facesContext.getViewRoot().getViewId(), "/page4.jsp");

        // case 5: exact from-view-id match, with from-outcome, no from-action
        viewRoot.setViewId("/from5.jsp");
        _facesContext.setViewRoot(viewRoot);
        navigationHandler.handleNavigation(_facesContext, "#{anyaction}", "outcome5");
        assertEquals(_facesContext.getViewRoot().getViewId(), "/page5.jsp");

        // case 6: wildcard from-view-id match, with from-outcome, no from-action
        viewRoot.setViewId("/context6/anypage.jsp");
        _facesContext.setViewRoot(viewRoot);
View Full Code Here

        assertEquals(_facesContext.getViewRoot().getViewId(), "/page5.jsp");

        // case 6: wildcard from-view-id match, with from-outcome, no from-action
        viewRoot.setViewId("/context6/anypage.jsp");
        _facesContext.setViewRoot(viewRoot);
        navigationHandler.handleNavigation(_facesContext, "#{anyaction}", "outcome6");
        assertEquals(_facesContext.getViewRoot().getViewId(), "/page6.jsp");

        // no match
        viewRoot.setViewId("/anycontext/anypage.jsp");
        _facesContext.setViewRoot(viewRoot);
View Full Code Here

        assertEquals(_facesContext.getViewRoot().getViewId(), "/page6.jsp");

        // no match
        viewRoot.setViewId("/anycontext/anypage.jsp");
        _facesContext.setViewRoot(viewRoot);
        navigationHandler.handleNavigation(_facesContext, "#{anyaction}", "anyoutcome");
        assertEquals(_facesContext.getViewRoot().getViewId(), "/anycontext/anypage.jsp");

    }

}
View Full Code Here

      ExternalContext externalContext = context.getExternalContext();
      Map<String, Object> applicationMap = externalContext.getApplicationMap();
      if (!applicationMap.containsKey(CONSUMER_REGISTRY) || !applicationMap.containsKey(PRODUCER_CONFIGURATION_SERVICE))
      {
         NavigationHandler navigationHandler = context.getApplication().getNavigationHandler();
         navigationHandler.handleNavigation(context, null, "error");
      }
   }

   public PhaseId getPhaseId()
   {
View Full Code Here

  }
 
  public void goingWithGuide(){
    FacesContext facesContext =  FacesContext.getCurrentInstance();
    NavigationHandler navHandler = facesContext.getApplication().getNavigationHandler();
    navHandler.handleNavigation(facesContext, null, "/road.jsf");
  }
 
  public void stopGuide(){
    conversation.end();
  }
View Full Code Here

    @Override
    public void handle() throws FacesException {
        if (getUnhandledExceptionQueuedEvents().iterator().hasNext()) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            NavigationHandler navHandler = facesContext.getApplication().getNavigationHandler();
            navHandler.handleNavigation(facesContext, null, "/error.jsf?faces-redirect=true");
        }
    }
}
View Full Code Here

            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

                // 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");
View Full Code Here

                    fc.renderResponse();

                } else if (t instanceof ViewExpiredException) {

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

                }

            } finally {
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.