You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/05/09 17:35:16 UTC

DO NOT REPLY [Bug 19801] New: - Request dispatcher does not set empty javax.servlet.include request attributes

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19801>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19801

Request dispatcher does not set empty javax.servlet.include request attributes

           Summary: Request dispatcher does not set empty
                    javax.servlet.include request attributes
           Product: Tomcat 4
           Version: 4.1.24
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: matthias.ernst@coremedia.com


The request dispatcher has a bug.

Do an include chain as follows:

Servlet A, mapped at /A/* includes "/B/should.not.see"
Servlet B, mapped at /B/* includes "/C"
Servlet C, mapped at /C/* prints out
request.getAttribute("javax.servlet.include.path_info")

According to my interpretation of the spec and as resin 2.1.9 does, the value
should be null. Tomcat 4.1.24 prints "/should.not.see" instead.

Different, funny example:

/A includes /B/hello includes /world, where /hello and /world are static files.
The default servlet in the last step will use path_info and therefore include
'/hello'.

Culprit is org.apache.catalina.core.ApplicationDispatcher#doInclude. I would
dispose of all the if's in the following code fragment:

            if (sb.length() > 0)
                wrequest.setAttribute(Globals.REQUEST_URI_ATTR,
                                      sb.toString());
            if (contextPath != null)
                wrequest.setAttribute(Globals.CONTEXT_PATH_ATTR,
                                      contextPath);
            if (servletPath != null)
                wrequest.setAttribute(Globals.SERVLET_PATH_ATTR,
                                      servletPath);
            if (pathInfo != null)
                wrequest.setAttribute(Globals.PATH_INFO_ATTR,
                                      pathInfo);
            if (queryString != null) {
                wrequest.setAttribute(Globals.QUERY_STRING_ATTR,
                                      queryString);
                wrequest.mergeParameters(queryString);
            }

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