Author: ehillenius
Date: Fri Jan 12 18:48:01 2007
New Revision: 495823
URL: http://svn.apache.org/viewvc?view=rev&rev=495823
Log:
WICKET-205
Modified:
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
Modified:
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
URL:
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/WicketFilter.java?view=diff&rev=495823&r1=495822&r2=495823
==============================================================================
---
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
(original)
+++
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
Fri Jan 12 18:48:01 2007
@@ -305,15 +305,18 @@
filterPath = filterPath.substring(1);
}
}
- else if (filterPath == null)
- filterPath = "";
- if (!path.endsWith("/"))
- {
- rootPath = path + "/" + filterPath;
- }
- else
- {
- rootPath = path + filterPath;
+
+ rootPath = path;
+
+ if (filterPath != null) {
+ if (!path.endsWith("/"))
+ {
+ rootPath = rootPath + "/" + filterPath;
+ }
+ else
+ {
+ rootPath = rootPath + filterPath;
+ }
}
}
return rootPath;
@@ -513,12 +516,18 @@
// Homepage
if (url.startsWith(fullRootPath))
{
+ // url == "/"
+ // fullRootPath == ""
+ if (url.equals("/"))
+ {
+ return true;
+ }
// url == fullRootPath
if (url.length() == fullRootPath.length())
{
return true;
}
- //
+ // NOTE: a semicolon may be delimiting the jsessionid
in the URI
if ((url.length() > fullRootPath.length())
&& (url.charAt(fullRootPath.length())
== ';'))
{
Modified:
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
URL:
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java?view=diff&rev=495823&r1=495822&r2=495823
==============================================================================
---
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
(original)
+++
incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
Fri Jan 12 18:48:01 2007
@@ -231,10 +231,12 @@
if (path != null)
{
CharSequence prefix = urlPrefix(requestCycle);
- // special check if the prefix ends on '/' because a
mount always
- // starts with '/'
- if (prefix.charAt(prefix.length() - 1) == '/')
- prefix = prefix.subSequence(0, prefix.length()
- 1);
+ if (prefix.length() > 0) {
+ // special check if the prefix ends on '/'
because a mount always
+ // starts with '/'
+ if (prefix.charAt(prefix.length() - 1) == '/')
+ prefix = prefix.subSequence(0,
prefix.length() - 1);
+ }
final AppendingStringBuffer buffer = new
AppendingStringBuffer(prefix.length()
+ path.length());
buffer.append(prefix);