You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2012/04/26 21:36:02 UTC
svn commit: r1331045 - in /myfaces/core/branches/2.0.x/impl/src:
main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java
Author: lu4242
Date: Thu Apr 26 19:36:01 2012
New Revision: 1331045
URL: http://svn.apache.org/viewvc?rev=1331045&view=rev
Log:
MYFACES-3530 Implicit Navigation Does Not Work After ViewExpiredException (Thanks to Paul Nicolucci for provide this patch)
Modified:
myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java
Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java?rev=1331045&r1=1331044&r2=1331045&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java Thu Apr 26 19:36:01 2012
@@ -139,6 +139,7 @@ public class NavigationHandlerImpl
String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId() : null;
if ( partialViewContext.isPartialRequest() &&
!partialViewContext.isRenderAll() &&
+ toViewId != null &&
!toViewId.equals(viewId))
{
partialViewContext.setRenderAll(true);
@@ -169,6 +170,7 @@ public class NavigationHandlerImpl
String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId() : null;
if ( partialViewContext.isPartialRequest() &&
!partialViewContext.isRenderAll() &&
+ newViewId != null &&
!newViewId.equals(viewId))
{
partialViewContext.setRenderAll(true);
@@ -383,9 +385,13 @@ public class NavigationHandlerImpl
{
startWithSlash = (viewIdToTest.charAt(0) == '/');
}
- if (!startWithSlash && viewId != null)
+ if (!startWithSlash)
{
- index = viewId.lastIndexOf ("/");
+ index = -1;
+ if( viewId != null )
+ {
+ index = viewId.lastIndexOf ("/");
+ }
if (index == -1)
{
Modified: myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java?rev=1331045&r1=1331044&r2=1331045&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/application/NavigationHandlerImplTest.java Thu Apr 26 19:36:01 2012
@@ -598,7 +598,7 @@ public class NavigationHandlerImplTest e
underTest.handleNavigation(facesContext, null, "viewExpired");
assertNotNull(facesContext.getViewRoot());
- assertEquals("viewExpired", facesContext.getViewRoot().getViewId());
+ assertEquals("/viewExpired", facesContext.getViewRoot().getViewId());
}