tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47378] welcome-file ignores servlet mapping
Date Wed, 29 Jul 2009 08:56:29 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47378





--- Comment #9 from Rex Wang <rwonly@gmail.com>  2009-07-29 01:56:26 PST ---
hi Tim, I tried adding this, but it does not work...
btw, I added one line: String pathStr = path.toString(); to pass compiling.
-Rex

(In reply to comment #8)
> This might work as a patch to org.apache.tomcat.util.http.mapper.Mapper - add
> it before // Rule 7 -- Default servlet and after          // Rule 4 -- Welcome
> resources processing for servlets
> 
>         // DAMMIT - welcome file processing - take 2
>         // take first matching welcome match
>         // its a copy of rule 4 since it needs to do less
>         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);
>                     if (mappingData.wrapper == null
>                         && context.defaultWrapper != null) {
>                         mappingData.wrapper =
>                             context.defaultWrapper.object;
>                         mappingData.requestPath.setChars
>                             (path.getBuffer(), path.getStart(),
>                              path.getLength());
>                         mappingData.wrapperPath.setChars
>                             (path.getBuffer(), path.getStart(),
>                              path.getLength());
>                         mappingData.requestPath.setString(pathStr);
>                         mappingData.wrapperPath.setString(pathStr);
>                     }
>                 }
> 
>                 path.setOffset(servletPath);
>                 path.setEnd(pathEnd);
>             }
> 
>         }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message