Author: ivaynberg
Date: Wed Dec 9 17:20:47 2009
New Revision: 888879
URL: http://svn.apache.org/viewvc?rev=888879&view=rev
Log:
WICKET-2600
Issue: WICKET-2600
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java?rev=888879&r1=888878&r2=888879&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/basic/RedirectRequestTarget.java
Wed Dec 9 17:20:47 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/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java?rev=888879&r1=888878&r2=888879&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java
(original)
+++
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/request/target/component/BookmarkablePageRequestTarget.java
Wed Dec 9 17:20:47 2009
@@ -248,11 +248,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);
}