You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mc...@apache.org on 2010/02/26 21:02:30 UTC
svn commit: r916800 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
Author: mconcini
Date: Fri Feb 26 20:02:30 2010
New Revision: 916800
URL: http://svn.apache.org/viewvc?rev=916800&view=rev
Log:
MYFACES-2581 - fix for double slash in prefix mapping
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java?rev=916800&r1=916799&r2=916800&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java Fri Feb 26 20:02:30 2010
@@ -260,9 +260,12 @@
*/
String uri = viewId;
prefix = prefix + '/'; //need to make sure its really /faces/* and not /facesPage.xhtml
- while (uri.startsWith(prefix))
+ while (uri.startsWith(prefix) || uri.startsWith("//"))
{
- uri = uri.substring(prefix.length() - 1); //cut off only /faces, leave the trailing '/' char for the next iteration
+ if(uri.startsWith(prefix))
+ uri = uri.substring(prefix.length() - 1); //cut off only /faces, leave the trailing '/' char for the next iteration
+ else //uri starts with '//'
+ uri = uri.substring(1); //cut off the leading slash, leaving the second slash to compare for the next iteration
}
//now delete any remaining leading '/'
// TODO: CJH: I don't think this is correct, considering that getActionURL() expects everything to