Extract the query string before we try to normalise the URI
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 3 Jul 2008 21:26:13 +0000 (21:26 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 3 Jul 2008 21:26:13 +0000 (21:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@673820 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/ApplicationContext.java

index eb4db27..19214e5 100644 (file)
@@ -369,10 +369,21 @@ public class ApplicationContext
             throw new IllegalArgumentException
                 (sm.getString
                  ("applicationContext.requestDispatcher.iae", path));
+
+        // Get query string
+        String queryString = null;
+        int pos = path.indexOf('?');
+        if (pos >= 0) {
+            queryString = path.substring(pos + 1);
+            path = path.substring(0, pos);
+        }
+
         path = normalize(path);
         if (path == null)
             return (null);
 
+        pos = path.length(); 
+
         // Use the thread local URI and mapping data
         DispatchData dd = dispatchData.get();
         if (dd == null) {
@@ -383,15 +394,6 @@ public class ApplicationContext
         MessageBytes uriMB = dd.uriMB;
         uriMB.recycle();
 
-        // Get query string
-        String queryString = null;
-        int pos = path.indexOf('?');
-        if (pos >= 0) {
-            queryString = path.substring(pos + 1);
-        } else {
-            pos = path.length();
-        }
         // Use the thread local mapping data
         MappingData mappingData = dd.mappingData;