Author: funkman Date: Mon Aug 31 13:59:00 2009 New Revision: 809596 URL: http://svn.apache.org/viewvc?rev=809596&view=rev Log: Allow welcome files without a physical backing. Inspired by this bug https://issues.apache.org/bugzilla/show_bug.cgi?id=47378
Modified: tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java?rev=809596&r1=809595&r2=809596&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/mapper/Mapper.java Mon Aug 31 13:59:00 2009 @@ -804,6 +804,36 @@ } + /* welcome file processing - take 2 + * Now that we have looked for welcome files with a physical + * backing, now look for an extension mapping listed + * but may not have a physical backing to it. This is for + * the case of index.jsf, index.do, etc. + * A watered down version of rule 4 + */ + if (mappingData.wrapper == null) { + boolean checkWelcomeFiles = checkJspWelcomeFiles; + if (!checkWelcomeFiles) { + char[] buf = path.getBuffer(); + checkWelcomeFiles = (buf[pathEnd - 1] == '/'); + } + if (checkWelcomeFiles) { + for (int i = 0; (i < context.welcomeResources.length) + && (mappingData.wrapper == null); i++) { + path.setOffset(pathOffset); + path.setEnd(pathEnd); + path.append(context.welcomeResources[i], 0, + context.welcomeResources[i].length()); + path.setOffset(servletPath); + internalMapExtensionWrapper(extensionWrappers, + path, mappingData); + } + + path.setOffset(servletPath); + path.setEnd(pathEnd); + } + } + // Rule 7 -- Default servlet if (mappingData.wrapper == null && !checkJspWelcomeFiles) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org