markt       2003/12/11 14:55:48

  Modified:    coyote/src/java/org/apache/coyote/tomcat4 CoyoteRequest.java
  Log:
  - Port of fix for bug 3098. Include the pathInfo when a relative path is used to get 
a request dispatcher.
  
  Revision  Changes    Path
  1.34      +17 -7     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java
  
  Index: CoyoteRequest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteRequest.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- CoyoteRequest.java        4 Dec 2003 13:55:53 -0000       1.33
  +++ CoyoteRequest.java        11 Dec 2003 22:55:48 -0000      1.34
  @@ -1091,13 +1091,23 @@
           if (servletPath == null)
               servletPath = getServletPath();
   
  -        int pos = servletPath.lastIndexOf('/');
  +        // Add the path info, if there is any
  +        String pathInfo = getPathInfo();
  +        String requestPath = null;
  +
  +        if (pathInfo == null) {
  +            requestPath = servletPath;
  +        } else {
  +            requestPath = servletPath + pathInfo;
  +        }
  +
  +        int pos = requestPath.lastIndexOf('/');
           String relative = null;
           if (pos >= 0) {
               relative = RequestUtil.normalize
  -                (servletPath.substring(0, pos + 1) + path);
  +                (requestPath.substring(0, pos + 1) + path);
           } else {
  -            relative = RequestUtil.normalize(servletPath + path);
  +            relative = RequestUtil.normalize(requestPath + path);
           }
   
           return (context.getServletContext().getRequestDispatcher(relative));
  
  
  

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

Reply via email to