You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/06/27 10:15:33 UTC
svn commit: r672185 -
/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/DirectNavigationHandler.java
Author: skitching
Date: Fri Jun 27 01:15:33 2008
New Revision: 672185
URL: http://svn.apache.org/viewvc?rev=672185&view=rev
Log:
Add better documentation. Describe limitations. Fix code layout and convert tabs to spaces.
Modified:
myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/DirectNavigationHandler.java
Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/DirectNavigationHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/DirectNavigationHandler.java?rev=672185&r1=672184&r2=672185&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/DirectNavigationHandler.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/tomahawk/util/DirectNavigationHandler.java Fri Jun 27 01:15:33 2008
@@ -25,27 +25,38 @@
import javax.faces.context.FacesContext;
/**
- * This is an alternative
- * implementation of the NavigationHandler,
- * directly using the outcome of an action
- * as the name of the page.
+ * 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.
+ * <p>
+ * 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.
+ * <p>
+ * When this navigation-handler is configured, all navigation-rule entries in
+ * faces-config.xml files are ignored completely.
+ * <p>
+ * This navigation handler does not work well in combination with other custom
+ * navigation handlers, as it never passes any calls down to underlying
+ * implementations.
*/
-public class DirectNavigationHandler extends NavigationHandler{
-
- /**
- * Gives the handleNavigation() method an alternative behaviour. Linking
- * is now processed directly to the given url (e.g. action="/pages/site.jsp").
+public class DirectNavigationHandler extends NavigationHandler
+{
+ /**
+ * 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.
- */
- public void handleNavigation(FacesContext context, String fromAction, String outcome) {
-
+ * There is no check if the outcome value really points to a valid page.
+ */
+ public void handleNavigation(FacesContext context, String fromAction, String outcome)
+ {
if(outcome == null || outcome.length()==0)
+ {
return;
+ }
ViewHandler viewHandler=context.getApplication().getViewHandler();
- UIViewRoot viewRoot=viewHandler.createView(context,outcome);
- context.setViewRoot(viewRoot);
- context.renderResponse();
- }
+ UIViewRoot viewRoot=viewHandler.createView(context,outcome);
+ context.setViewRoot(viewRoot);
+ context.renderResponse();
+ }
}