You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2009/12/09 18:14:49 UTC
svn commit: r888878 - in
/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target:
basic/RedirectRequestTarget.java component/BookmarkablePageRequestTarget.java
Author: ivaynberg
Date: Wed Dec 9 17:14:49 2009
New Revision: 888878
URL: http://svn.apache.org/viewvc?rev=888878&view=rev
Log:
WICKET-2600
Issue: WICKET-2600
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java
wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java?rev=888878&r1=888877&r2=888878&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java Wed Dec 9 17:14:49 2009
@@ -88,9 +88,10 @@
.getProcessor()
.getRequestCodingStrategy()
.rewriteStaticRelativeUrl(redirectUrl.substring(1));
- if (location.startsWith("./") && location.length() > 2)
+ // IE does not understand "./" in a path, just "." is okay.
+ if (location.startsWith("./"))
{
- location = location.substring(2);
+ location = location.length() == 2 ? "." : location.substring(2);
}
response.redirect(location);
}
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java?rev=888878&r1=888877&r2=888878&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java Wed Dec 9 17:14:49 2009
@@ -193,11 +193,10 @@
String redirectUrl = processor.getRequestCodingStrategy()
.encode(requestCycle, this)
.toString();
- // WICKET-1916 - if we are redirecting to homepage, then redirectUrl equals "./",
- // and if we strip it to blank, no redirect occurs
- if (redirectUrl.startsWith("./") && redirectUrl.length() > 2)
+ // IE does not understand "./" in a path, just "." is okay.
+ if (redirectUrl.startsWith("./"))
{
- redirectUrl = redirectUrl.substring(2);
+ redirectUrl = redirectUrl.length() == 2 ? "." : redirectUrl.substring(2);
}
requestCycle.getResponse().redirect(redirectUrl);
}