myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mconc...@apache.org
Subject svn commit: r815461 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle: LifecycleImpl.java PhaseListenerManager.java
Date Tue, 15 Sep 2009 20:10:09 GMT
Author: mconcini
Date: Tue Sep 15 20:10:08 2009
New Revision: 815461

URL: http://svn.apache.org/viewvc?rev=815461&view=rev
Log:
MYFACES-2355 - fix for before phase listeners not redirecting to error page on exceptions.

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java?rev=815461&r1=815460&r2=815461&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
Tue Sep 15 20:10:08 2009
@@ -178,13 +178,13 @@
             facesContext.setCurrentPhaseId(renderExecutor.getPhase());
             
             flash.doPrePhaseActions(facesContext);
-            phaseListenerMgr.informPhaseListenersBefore(renderExecutor.getPhase());
+            boolean renderResponse = phaseListenerMgr.informPhaseListenersBefore(renderExecutor.getPhase());
             // also possible that one of the listeners completed the response
             if (isResponseComplete(facesContext, renderExecutor.getPhase(), true))
             {
                 return;
             }
-
+            if(renderResponse)
             renderExecutor.execute(facesContext);
         }
         

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java?rev=815461&r1=815460&r2=815461&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/PhaseListenerManager.java
Tue Sep 15 20:10:08 2009
@@ -60,11 +60,11 @@
         return (listenerPhaseId == PhaseId.ANY_PHASE.getOrdinal() || listenerPhaseId == phaseId.getOrdinal());
     }
 
-    void informPhaseListenersBefore(PhaseId phaseId)
+    boolean informPhaseListenersBefore(PhaseId phaseId)
     {
         boolean[] beforePhaseSuccess = new boolean[phaseListeners.length];
         listenerSuccessMap.put(phaseId, beforePhaseSuccess);
-
+        
         for (int i = 0; i < phaseListeners.length; i++)
         {
             PhaseListener phaseListener = phaseListeners[i];
@@ -83,10 +83,11 @@
                     
                     publishException (e, phaseId, ExceptionQueuedEventContext.IN_BEFORE_PHASE_KEY);
                     
-                    return;
+                    return false;   //if this is the render phase, do not render so we can
go to the error page
                 }
             }
         }
+        return true; //if this is the render phase, render the response
     }
 
     void informPhaseListenersAfter(PhaseId phaseId)



Mime
View raw message