Class DirectNavigationHandler

  extended by javax.faces.application.NavigationHandler
      extended by org.apache.myfaces.tomahawk.util.DirectNavigationHandler

public class DirectNavigationHandler
extends javax.faces.application.NavigationHandler

An alternative implementation of the standard JSF NavigationHandler API which directly using the outcome of an action as the name of the page to navigate to.

This bypasses the "logical navigation" approach of standard JSF, so that pages can be wired together by using actual urls in command actions and action-method return values.

When this navigation-handler is configured, all navigation-rule entries in faces-config.xml files are ignored completely.

This navigation handler does not work well in combination with other custom navigation handlers, as it never passes any calls down to underlying implementations. Having another NavigationHandler decorate this one will work; having this navigation handler decorate another will not as the decorated handler will never be invoked. Therefore if multiple navigation handlers are to be used (eg the Tomahawk RedirectTrackerNavigationHandler in combination with this one), then this should be listed first in the faces-config.xml file so that the other handlers decorate this one.

Constructor Summary
Method Summary
 void handleNavigation(javax.faces.context.FacesContext context, String fromAction, String outcome)
          Gives the handleNavigation() method an alternative behaviour.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DirectNavigationHandler()
Method Detail


public void handleNavigation(javax.faces.context.FacesContext context,
                             String fromAction,
                             String outcome)
Gives the handleNavigation() method an alternative behaviour. Linking is now processed directly to the given url (e.g. action="/pages/site.jsp"). There is no check if the outcome value really points to a valid page.

Specified by:
handleNavigation in class javax.faces.application.NavigationHandler

Copyright © 2012 The Apache Software Foundation. All Rights Reserved.