Author: ehillenius
Date: Fri Jan 12 18:48:43 2007
New Revision: 495824

URL: http://svn.apache.org/viewvc?view=rev&rev=495824
Log:
WICKET-205

Modified:
    incubator/wicket/trunk/wicket/.classpath
    
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
    
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java

Modified: incubator/wicket/trunk/wicket/.classpath
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/.classpath?view=diff&rev=495824&r1=495823&r2=495824
==============================================================================
--- incubator/wicket/trunk/wicket/.classpath (original)
+++ incubator/wicket/trunk/wicket/.classpath Fri Jan 12 18:48:43 2007
@@ -1,13 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="src" output="target/test-classes" 
path="src/test/java"/>
-       <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-       <classpathentry kind="var" 
path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar" 
sourcepath="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13-sources.jar"/>
-       <classpathentry kind="var" 
path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar" 
sourcepath="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3-sources.jar"/>
-       <classpathentry kind="var" 
path="M2_REPO/javax/portlet/portlet-api/1.0/portlet-api-1.0.jar"/>
-       <classpathentry kind="var" 
path="M2_REPO/org/slf4j/slf4j-log4j12/1.1.0/slf4j-log4j12-1.1.0.jar" 
sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.1.0/slf4j-log4j12-1.1.0-sources.jar"/>
-       <classpathentry kind="var" 
path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" 
sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
-       <classpathentry kind="var" 
path="M2_REPO/org/slf4j/slf4j-api/1.1.0/slf4j-api-1.1.0.jar" 
sourcepath="M2_REPO/org/slf4j/slf4j-api/1.1.0/slf4j-api-1.1.0-sources.jar"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" 
output="target/test-classes"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" 
sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+  <classpathentry kind="var" 
path="M2_REPO/javax/portlet/portlet-api/1.0/portlet-api-1.0.jar"/>
+  <classpathentry kind="var" 
path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar" 
sourcepath="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13-sources.jar"/>
+  <classpathentry kind="var" 
path="M2_REPO/org/slf4j/slf4j-log4j12/1.1.0/slf4j-log4j12-1.1.0.jar" 
sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.1.0/slf4j-log4j12-1.1.0-sources.jar"/>
+  <classpathentry kind="var" 
path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar" 
sourcepath="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3-sources.jar"/>
+  <classpathentry kind="var" 
path="M2_REPO/org/slf4j/slf4j-api/1.1.0/slf4j-api-1.1.0.jar" 
sourcepath="M2_REPO/org/slf4j/slf4j-api/1.1.0/slf4j-api-1.1.0-sources.jar"/>
+</classpath>
\ No newline at end of file

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/WicketFilter.java?view=diff&rev=495824&r1=495823&r2=495824
==============================================================================
--- 
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
 (original)
+++ 
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/WicketFilter.java
 Fri Jan 12 18:48:43 2007
@@ -288,15 +288,19 @@
                                {
                                        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;
@@ -480,20 +484,26 @@
                String fullRootPath = getRootPath(request);
                String url = request.getRequestURI();
 
-               // Homepage
-               if (url.startsWith(fullRootPath))
-               {
-                       // url == fullRootPath
-                       if (url.length() == fullRootPath.length())
-                       {
-                               return true;
-                       }
-                       //  
-                       if ((url.length() > fullRootPath.length())
-                                       && (url.charAt(fullRootPath.length()) 
== ';'))
-                       {
-                               return true;
-                       }
+               // 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()) 
== ';'))
+                       {
+                               return true;
+                       }
                }
                // SharedResources
                String tmp = Strings.join("/", fullRootPath, 
RESOURCES_PATH_PREFIX);

Modified: 
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java?view=diff&rev=495824&r1=495823&r2=495824
==============================================================================
--- 
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
 (original)
+++ 
incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/request/WebRequestCodingStrategy.java
 Fri Jan 12 18:48:43 2007
@@ -149,8 +149,12 @@
                        // ends on '/' because a mount always starts with '/'
                        // because rootPath see WicketServlet will always 
contain a "/" and
                        // context path and filterpath are both ""
-                       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);


Reply via email to