myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mconc...@apache.org
Subject svn commit: r811053 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
Date Thu, 03 Sep 2009 17:36:33 GMT
Author: mconcini
Date: Thu Sep  3 17:36:32 2009
New Revision: 811053

URL: http://svn.apache.org/viewvc?rev=811053&view=rev
Log:
MYFACES-2334 - don't automatically ignore null outcomes 

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java?rev=811053&r1=811052&r2=811053&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
Thu Sep  3 17:36:32 2009
@@ -69,12 +69,6 @@
     @Override
     public void handleNavigation(FacesContext facesContext, String fromAction, String outcome)
     {
-        if (outcome == null)
-        {
-            // stay on current ViewRoot
-            return;
-        }
-
         NavigationCase navigationCase = getNavigationCase(facesContext, fromAction, outcome);
 
         if (navigationCase != null)
@@ -176,15 +170,15 @@
             }
         }
         
-        if (navigationCase == null)
+        if (outcome != null && navigationCase == null)
         {
-            // Still can't find a navigation case, so we need to look at the outcome and
see what navigation case
-            // can be determined from it.
-            
+            //if outcome is null, we don't check outcome based nav cases
+            //otherwise, if navgiationCase is still null, check outcome-based nav cases
             navigationCase = getOutcomeNavigationCase (facesContext, fromAction, outcome);
         }
-        
-        return navigationCase;
+
+        return navigationCase;  //if navigationCase == null, will stay on current view
+
     }
     
     /**
@@ -333,7 +327,12 @@
             boolean ifMatches = (cazeIf == null ? false : cazeIf.booleanValue());
             // JSF 2.0: support conditional navigation via <if>.
             // Use for later cases.
-
+            
+            if(outcome == null && (cazeOutcome != null || cazeIf == null))
+            {
+                continue;   //To match an outcome value of null, the <from-outcome>
must be absent and the <if> element present.
+            }
+            
             if (cazeActionRef != null) {
                 if (cazeOutcome != null) {
                     if ((actionRef != null) && (outcome != null) && cazeActionRef.equals
(actionRef) &&



Mime
View raw message