Author: markt
Date: Wed Jul 30 02:35:27 2008
New Revision: 680950
URL: http://svn.apache.org/viewvc?rev=680950&view=rev
Log:
Port r673820 to 4.1.x
Extract the query string before we try to normalise the URI
Modified:
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
Modified:
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
URL:
http://svn.apache.org/viewvc/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/core/ApplicationContext.java?rev=680950&r1=680949&r2=680950&view=diff
==============================================================================
---
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
(original)
+++
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/core/ApplicationContext.java
Wed Jul 30 02:35:27 2008
@@ -581,6 +581,15 @@
if (!path.startsWith("/"))
throw new IllegalArgumentException
(sm.getString("applicationContext.requestDispatcher.iae", path));
+
+ // Get query string
+ String queryString = null;
+ int question = path.indexOf('?');
+ if (question >= 0) {
+ queryString = path.substring(question + 1);
+ path = path.substring(0, question);
+ }
+
path = normalize(path);
if (path == null)
return (null);
@@ -589,24 +598,17 @@
String contextPath = context.getPath();
if (contextPath == null)
contextPath = "";
- String relativeURI = path;
- String queryString = null;
- int question = path.indexOf('?');
- if (question >= 0) {
- relativeURI = path.substring(0, question);
- queryString = path.substring(question + 1);
- }
if( System.getSecurityManager() != null ) {
PrivilegedGetRequestDispatcher dp =
new PrivilegedGetRequestDispatcher(contextPath,
- relativeURI,queryString);
+ path,queryString);
return (RequestDispatcher)AccessController.doPrivileged(dp);
}
// The remaining code is duplicated in PrivilegedGetRequestDispatcher,
// we need to make sure they stay in sync
HttpRequest request = new MappingRequest
- (context.getPath(), contextPath + relativeURI, queryString);
+ (context.getPath(), contextPath + path, queryString);
/*
request.setContext(context);
request.setContextPath(context.getPath());
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]