tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aburgel <>
Subject DefaultServlet & PathInfo
Date Fri, 11 May 2007 21:37:16 GMT


i have an issue when using the following servlet mapping and DefaultServlet:



my goal is to have specific directories served by DefaultServlet and then
everything else to be served by my servlet.

however, the way that DefaultServlet is implemented seems to make this
impossible, since it uses request.getPathInfo() to get the path of the file.

for the above mapping, if i request '/images/pic.gif', then the PathInfo
would be '/pic.gif'. since that file lives in '/images/pic.gif', i get a

i can't really think of any useful case where it makes sense for
DefaultServlet to only consider PathInfo. (there might be a case where you
wanted to serve the same resource via the DefaultServlet and another
servlet, but i would imagine thats pretty uncommon.)

i think it makes more sense to use ServletPath + PathInfo instead. making
this change won't affect the standard usage of DefaultServlet because in
that case PathInfo is null and it falls back to using ServletPath anyways.
and for all other cases, DefaultServlet is kind of useless, so i doubt it
would affect anyone.

View this message in context:
Sent from the Tomcat - Dev mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message