From: markt Date: Wed, 17 Sep 2008 11:11:42 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45441 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e16ee4b311b071867bf75abc728c3ace2ca640a9;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45441 Filters for INCLUDE/FORWARD need to be matched against servletPath+pathinfo git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@696240 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/ApplicationDispatcher.java b/java/org/apache/catalina/core/ApplicationDispatcher.java index d7225bdb7..f9b4bba50 100644 --- a/java/org/apache/catalina/core/ApplicationDispatcher.java +++ b/java/org/apache/catalina/core/ApplicationDispatcher.java @@ -429,7 +429,7 @@ final class ApplicationDispatcher if (disInt.intValue() != ApplicationFilterFactory.ERROR) { state.outerRequest.setAttribute (ApplicationFilterFactory.DISPATCHER_REQUEST_PATH_ATTR, - servletPath); + getCombinedPath()); state.outerRequest.setAttribute (ApplicationFilterFactory.DISPATCHER_TYPE_ATTR, Integer.valueOf(ApplicationFilterFactory.FORWARD)); @@ -442,7 +442,23 @@ final class ApplicationDispatcher } - + /** + * Combine the servletPath and the pathInfo. If pathInfo is + * null it is ignored. If servletPath is null then + * null is returned. + * @return The combined path with pathInfo appended to servletInfo + */ + private String getCombinedPath() { + if (servletPath == null) { + return null; + } + if (pathInfo == null) { + return servletPath; + } + return servletPath + pathInfo; + } + + /** * Include the response from another resource in the current response. * Any runtime exception, IOException, or ServletException thrown by the @@ -499,7 +515,7 @@ final class ApplicationDispatcher Integer.valueOf(ApplicationFilterFactory.INCLUDE)); wrequest.setAttribute( ApplicationFilterFactory.DISPATCHER_REQUEST_PATH_ATTR, - servletPath); + getCombinedPath()); invoke(state.outerRequest, state.outerResponse, state); } @@ -531,7 +547,7 @@ final class ApplicationDispatcher Integer.valueOf(ApplicationFilterFactory.INCLUDE)); wrequest.setAttribute( ApplicationFilterFactory.DISPATCHER_REQUEST_PATH_ATTR, - servletPath); + getCombinedPath()); invoke(state.outerRequest, state.outerResponse, state); }