bip 01/10/22 13:47:42
Modified: catalina/src/share/org/apache/catalina/util/ssi
SsiMediator.java
Log:
Fix for relativepath issues across contexts.
PR: 4326 / 4307
Submitted by: [EMAIL PROTECTED] (Rami Hänninen) /
[EMAIL PROTECTED]
Revision Changes Path
1.8 +9 -10
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java
Index: SsiMediator.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SsiMediator.java 2001/07/22 20:25:15 1.7
+++ SsiMediator.java 2001/10/22 20:47:42 1.8
@@ -1,8 +1,8 @@
/*
* SsiMediator.java
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v
1.7 2001/07/22 20:25:15 pier Exp $
- * $Revision: 1.7 $
- * $Date: 2001/07/22 20:25:15 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/ssi/SsiMediator.java,v
1.8 2001/10/22 20:47:42 bip Exp $
+ * $Revision: 1.8 $
+ * $Date: 2001/10/22 20:47:42 $
*
* ====================================================================
*
@@ -86,7 +86,7 @@
/**
* @author Bip Thelin
* @author Amy Roh
- * @version $Revision: 1.7 $, $Date: 2001/07/22 20:25:15 $
+ * @version $Revision: 1.8 $, $Date: 2001/10/22 20:47:42 $
*
*/
public class SsiMediator {
@@ -404,13 +404,12 @@
}else if (path.indexOf('/', 1)==-1) {
//root context
servletContext = servletContext.getContext("/");
- } else if (!contextPath.equals("")) {
+ } else if (!contextPath.equals("") &&
+ (normalized !=null) && (normalized.startsWith(contextPath)))
{
//starts with the context path of this webapp
- if ((normalized !=null) && (normalized.startsWith(contextPath))) {
- // strip off the context path
- servletContext = servletContext.getContext(contextPath);
- normalized = normalized.substring(contextPath.length());
- }
+ // strip off the context path
+ servletContext = servletContext.getContext(contextPath);
+ normalized = normalized.substring(contextPath.length());
} else if (normalized != null){
// find which context is the right one to handle
String context = normalized.substring(0, path.indexOf('/', 1));