Package javax.faces.application

Examples of javax.faces.application.NavigationHandler


                Object result = method.invoke(this);
                if (result != null)
                {
                    String outcome = result.toString();
                    // Retrieve the NavigationHandler instance..
                    NavigationHandler navHandler = context.getApplication().getNavigationHandler();
                    // Invoke nav handling..
                    navHandler.handleNavigation(context, action, outcome);
                    // Trigger a switch to Render Response if needed
                    context.renderResponse();
                    return;
                }
                restoreSessionMessage();
View Full Code Here


        if (log.isDebugEnabled())
            log.debug("Redirecting from page {} to page {}.", getPageName(), outcome.toString());
        // Return to Parent
        FacesContext context = FacesContext.getCurrentInstance();
        // Retrieve the NavigationHandler instance..
        NavigationHandler navHandler = context.getApplication().getNavigationHandler();
        // Invoke nav handling..
        navHandler.handleNavigation(context, action, outcome.toString());
        // Trigger a switch to Render Response if needed
        context.renderResponse();
    }
View Full Code Here

        if (dispenser.getMessageBundle() != null)
        {
            application.setMessageBundle(dispenser.getMessageBundle());
        }
       
        NavigationHandler navigationHandler = ClassUtils.buildApplicationObject(NavigationHandler.class,
                ConfigurableNavigationHandler.class,
                BackwardsCompatibleNavigationHandlerWrapper.class,
                dispenser.getNavigationHandlerIterator(),
                application.getNavigationHandler());
        _callInjectAndPostConstruct(navigationHandler);
View Full Code Here

        if (pool != null && pool.isDeferredNavigationEnabled() &&
            processor.isViewPoolStrategyAllowedForThisView(facesContext, root) &&
            (PhaseId.INVOKE_APPLICATION.equals(facesContext.getCurrentPhaseId()) ||
             PhaseId.APPLY_REQUEST_VALUES.equals(facesContext.getCurrentPhaseId())) )
        {
            NavigationHandler navigationHandler = application.getNavigationHandler();
            if (navigationHandler instanceof ConfigurableNavigationHandler)
            {
                NavigationCase navigationCase = ((ConfigurableNavigationHandler) navigationHandler).
                    getNavigationCase(facesContext, fromAction, outcome);
                if (navigationCase != null)
                {
                    // Deferred invoke navigation. The first one wins
                    if (!facesContext.getAttributes().containsKey(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION))
                    {
                        String toFlowDocumentId = (component != null) ?
                            (String) component.getAttributes().get(ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME) : null;
                        if (toFlowDocumentId != null)
                        {
                            facesContext.getAttributes().put(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION,
                                    new Object[]{fromAction, outcome, toFlowDocumentId});
                        }
                        else
                        {
                            facesContext.getAttributes().put(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION,
                                    new Object[]{fromAction, outcome});
                        }
                    }
                }
            }
        }
        else
        {
            NavigationHandler navigationHandler = application.getNavigationHandler();
            String toFlowDocumentId = (component != null) ?
                (String) component.getAttributes().get(ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME) : null;

            if (toFlowDocumentId != null)
            {
                navigationHandler.handleNavigation(facesContext, fromAction, outcome, toFlowDocumentId);
            }
            else
            {
                navigationHandler.handleNavigation(facesContext, fromAction, outcome);
            }
            //Render Response if needed
            facesContext.renderResponse();
        }
    }
View Full Code Here

        if (pool != null && pool.isDeferredNavigationEnabled() &&
            processor.isViewPoolStrategyAllowedForThisView(facesContext, root) &&
            (PhaseId.INVOKE_APPLICATION.equals(facesContext.getCurrentPhaseId()) ||
             PhaseId.APPLY_REQUEST_VALUES.equals(facesContext.getCurrentPhaseId())) )
        {
            NavigationHandler navigationHandler = application.getNavigationHandler();
            if (navigationHandler instanceof ConfigurableNavigationHandler)
            {
                NavigationCase navigationCase = ((ConfigurableNavigationHandler) navigationHandler).
                    getNavigationCase(facesContext, fromAction, outcome);
                if (navigationCase != null)
                {
                    // Deferred invoke navigation. The first one wins
                    if (!facesContext.getAttributes().containsKey(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION))
                    {
                        String toFlowDocumentId = (component != null) ?
                            (String) component.getAttributes().get(ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME) : null;
                        if (toFlowDocumentId != null)
                        {
                            facesContext.getAttributes().put(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION,
                                    new Object[]{fromAction, outcome, toFlowDocumentId});
                        }
                        else
                        {
                            facesContext.getAttributes().put(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION,
                                    new Object[]{fromAction, outcome});
                        }
                    }
                }
            }
        }
        else
        {
            NavigationHandler navigationHandler = application.getNavigationHandler();
            String toFlowDocumentId = (component != null) ?
                (String) component.getAttributes().get(ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME) : null;

            if (toFlowDocumentId != null)
            {
                navigationHandler.handleNavigation(facesContext, fromAction, outcome, toFlowDocumentId);
            }
            else
            {
                navigationHandler.handleNavigation(facesContext, fromAction, outcome);
            }
            //Render Response if needed
            facesContext.renderResponse();
        }
    }
View Full Code Here

        if (dispenser.getMessageBundle() != null)
        {
            application.setMessageBundle(dispenser.getMessageBundle());
        }
       
        NavigationHandler navigationHandler = ClassUtils.buildApplicationObject(NavigationHandler.class,
                ConfigurableNavigationHandler.class,
                BackwardsCompatibleNavigationHandlerWrapper.class,
                dispenser.getNavigationHandlerIterator(),
                application.getNavigationHandler());
        _callInjectAndPostConstruct(navigationHandler);
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

                outcome = objOutcome.toString();
            }

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

    }
View Full Code Here

        if (pool != null && pool.isDeferredNavigationEnabled() &&
            processor.isViewPoolStrategyAllowedForThisView(facesContext, root) &&
            (PhaseId.INVOKE_APPLICATION.equals(facesContext.getCurrentPhaseId()) ||
             PhaseId.APPLY_REQUEST_VALUES.equals(facesContext.getCurrentPhaseId())) )
        {
            NavigationHandler navigationHandler = application.getNavigationHandler();
            if (navigationHandler instanceof ConfigurableNavigationHandler)
            {
                NavigationCase navigationCase = ((ConfigurableNavigationHandler) navigationHandler).
                    getNavigationCase(facesContext, fromAction, outcome);
                if (navigationCase != null)
                {
                    // Deferred invoke navigation. The first one wins
                    if (!facesContext.getAttributes().containsKey(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION))
                    {
                        String toFlowDocumentId = (component != null) ?
                            (String) component.getAttributes().get(ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME) : null;
                        if (toFlowDocumentId != null)
                        {
                            facesContext.getAttributes().put(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION,
                                    new Object[]{fromAction, outcome, toFlowDocumentId});
                        }
                        else
                        {
                            facesContext.getAttributes().put(ViewPoolProcessor.INVOKE_DEFERRED_NAVIGATION,
                                    new Object[]{fromAction, outcome});
                        }
                    }
                }
            }
        }
        else
        {
            NavigationHandler navigationHandler = application.getNavigationHandler();
            String toFlowDocumentId = (component != null) ?
                (String) component.getAttributes().get(ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME) : null;

            if (toFlowDocumentId != null)
            {
                navigationHandler.handleNavigation(facesContext, fromAction, outcome, toFlowDocumentId);
            }
            else
            {
                navigationHandler.handleNavigation(facesContext, fromAction, outcome);
            }
            //Render Response if needed
            facesContext.renderResponse();
        }
    }
View Full Code Here

        if (dispenser.getMessageBundle() != null)
        {
            application.setMessageBundle(dispenser.getMessageBundle());
        }
       
        NavigationHandler navigationHandler = ClassUtils.buildApplicationObject(NavigationHandler.class,
                ConfigurableNavigationHandler.class,
                BackwardsCompatibleNavigationHandlerWrapper.class,
                dispenser.getNavigationHandlerIterator(),
                application.getNavigationHandler());
        _callInjectAndPostConstruct(navigationHandler);
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.