larryi 01/03/13 21:57:48
Modified: src/share/org/apache/tomcat/modules/generators
StaticInterceptor.java
Log:
Ported tomcat_32 fix for web.xml <error-page> mapping to html.
Also, ported extra checks for WEB-INF and META-INF, and added a
getListings() method so the property isn't write only.
Note: The localized welcome file patch by Arieh Markel still needs to be
ported from tomcat_32.
Revision Changes Path
1.7 +12 -2
jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/StaticInterceptor.java
Index: StaticInterceptor.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/generators/StaticInterceptor.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StaticInterceptor.java 2001/03/08 01:09:52 1.6
+++ StaticInterceptor.java 2001/03/14 05:57:48 1.7
@@ -85,6 +85,10 @@
*/
private boolean listings = true;
+ public boolean getListings() {
+ return listings;
+ }
+
public void setListings(boolean listings) {
this.listings = listings;
}
@@ -260,7 +264,11 @@
subReq=req.getChild();
Context ctx=subReq.getContext();
- String pathInfo=subReq.servletPath().toString();
+ // Use "javax.servlet.include.servlet_path" for path if defined.
+ // ErrorHandler places the path here when invoking an error page.
+ String pathInfo =
(String)subReq.getAttribute("javax.servlet.include.servlet_path");
+ if(pathInfo == null)
+ pathInfo=subReq.servletPath().toString();
String absPath = (String)subReq.getNote( realFileNote );
if( absPath==null )
absPath=FileUtil.safePath( context.getAbsolutePath(),
@@ -332,7 +340,9 @@
String relPathU=relPath.toUpperCase();
if ( relPathU.startsWith("WEB-INF") ||
- relPathU.startsWith("META-INF")) {
+ relPathU.startsWith("META-INF") ||
+ (relPathU.indexOf("/WEB-INF/") >= 0) ||
+ (relPathU.indexOf("/META-INF/") >= 0) ) {
return null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]