tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peterbauer Karl <>
Subject bug with named dispatching and JSP's?
Date Tue, 09 May 2000 12:10:13 GMT

When I define a JSP "/jsp/foo.jsp" in the web.xml as named servlet "bar" using the <servlet>-tags
and use ServletContext.getNamedDispatcher("bar").include(req, resp), then I get a 404 error
saying that the file "/jsp/foo.jspnull" does not exist.

This seems to be a bug in org.apache.tomcat.core.ServletWrapper.handleRequest(Request req,
Response res), line 395:

String requestURI = path + req.getPathInfo();

If the request's pathInfo == null, then "null" is appended literally.
This can be easily fixed by not appending the path info and then the stuff works.

If the path info is appended if != null, then I also get a 404 because the original request's
path info is implicitly appended for the JSP file lookup. Don't know what the servlet spec
2.2 says about this problem, but I cannot image that the outcome of method ServletContext.getNamedDispatcher()
depends on the path info of the original request.

I think that this is an important thing to fix because getNamedDispatcher() has the advantage
that one does not have to code JSP paths into dispatching servlets but can use logical names
and map the names in web.xml.

Found bug in Tomcat 3.1 release build.

Karl Peterbauer

View raw message