billbarker    2004/05/27 22:02:08

  Modified:    util/java/org/apache/tomcat/util/http/mapper Mapper.java
  Log:
  Change mapping rules for request to /myapp.
  
  With this change, if the web-app defines a servlet-mapping for the pattern '/*', 
then a request for /myapp is forwarded to it.  Otherwise, the behavior is unchanged.
  
  This should allow Tomcat's webDAV servlet play nicer with MS's broken client.
  
  Revision  Changes    Path
  1.38      +13 -5     
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java
  
  Index: Mapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/mapper/Mapper.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- Mapper.java       18 Mar 2004 01:55:16 -0000      1.37
  +++ Mapper.java       28 May 2004 05:02:08 -0000      1.38
  @@ -634,17 +634,17 @@
           int pathOffset = path.getOffset();
           int pathEnd = path.getEnd();
           int servletPath = pathOffset;
  +        boolean noServletPath = false;
   
           int length = context.name.length();
           if (length != (pathEnd - pathOffset)) {
               servletPath = pathOffset + length;
           } else {
  -            // The path is empty, redirect to "/"
  +            noServletPath = true;
               path.append('/');
  -            mappingData.redirectPath.setChars
  -                (path.getBuffer(), path.getOffset(), path.getEnd());
  -            path.setEnd(path.getEnd() - 1);
  -            return;
  +            pathOffset = path.getOffset();
  +            pathEnd = path.getEnd();
  +            servletPath = pathOffset+length;
           }
   
           path.setOffset(servletPath);
  @@ -679,6 +679,14 @@
                       mappingData.pathInfo.recycle();
                   }
               }
  +        }
  +
  +        if(mappingData.wrapper == null && noServletPath) {
  +            // The path is empty, redirect to "/"
  +            mappingData.redirectPath.setChars
  +                (path.getBuffer(), pathOffset, pathEnd);
  +            path.setEnd(pathEnd - 1);
  +            return;
           }
   
           // Rule 3 -- Extension Match
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to