remm 02/03/21 19:54:33
Modified: coyote/src/java/org/apache/coyote/tomcat4 CoyoteRequest.java
Log:
- Fix bug 8646: dispatcher.forward() is confused when using
special servlet mapping URLs.
- Will be ported to the various other branches once I test that change more.
Revision Changes Path
1.12 +14 -5
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java
Index: CoyoteRequest.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- CoyoteRequest.java 19 Mar 2002 20:34:41 -0000 1.11
+++ CoyoteRequest.java 22 Mar 2002 03:54:33 -0000 1.12
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
1.11 2002/03/19 20:34:41 remm Exp $
- * $Revision: 1.11 $
- * $Date: 2002/03/19 20:34:41 $
+ * $Header:
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
1.12 2002/03/22 03:54:33 remm Exp $
+ * $Revision: 1.12 $
+ * $Date: 2002/03/22 03:54:33 $
*
* ====================================================================
*
@@ -122,7 +122,7 @@
*
* @author Remy Maucherat
* @author Craig R. McClanahan
- * @version $Revision: 1.11 $ $Date: 2002/03/19 20:34:41 $
+ * @version $Revision: 1.12 $ $Date: 2002/03/22 03:54:33 $
*/
public class CoyoteRequest
@@ -1035,7 +1035,16 @@
String servletPath = (String) getAttribute(Globals.SERVLET_PATH_ATTR);
if (servletPath == null)
servletPath = getServletPath();
- String relative = RequestUtil.normalize(servletPath + "/../" + path);
+
+ int pos = servletPath.lastIndexOf('/');
+ String relative = null;
+ if (pos > 0) {
+ relative = RequestUtil.normalize
+ (servletPath.substring(0, pos + 1) + path);
+ } else {
+ relative = RequestUtil.normalize(servletPath + path);
+ }
+
return (context.getServletContext().getRequestDispatcher(relative));
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>