From 98c2000643c1b4055b78db361f2de06efa7e9d4d Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 3 Jul 2008 21:26:13 +0000 Subject: [PATCH] Extract the query string before we try to normalise the URI git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@673820 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/catalina/core/ApplicationContext.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index eb4db2782..19214e5d9 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -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; -- 2.11.0