Bug 28323 - HttpServletRequest.getPathInfo() returns null in context of a Filter class
Summary: HttpServletRequest.getPathInfo() returns null in context of a Filter class
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 4.1.27
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2004-04-10 03:03 UTC by Wayne Schroeder
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Schroeder 2004-04-10 03:03:33 UTC
In the first lines of code in doFilter in my filter class, I have the following:

if (request instanceof HttpServletRequest)
  log("The URI is: " + ((HttpServletRequest)request).getRequestURI());
  log("The PathInfo is: " + ((HttpServletRequest)request).getPathInfo());

This filter is mapped to /*, when hit with a request to /path1/path2/file.ext
comes in, the following output is produced:

2004-04-09 21:57:23 The URI is: /path1/path2/file.ext
2004-04-09 21:57:23 The PathInfo is: null

I couldn't find anything that would lead me to belive that this is expected. 
Oracle's website has examples where getPathInfo is used in filter classes so I
would think I am not alone.  I realize this version of tomcat is a few rev's old
-- I checked the bug database before submitting and found nothing.  I am
guessing that the path info stuff is filled in after the filter chain is done.

Comment 1 william.barker 2004-04-10 05:05:23 UTC
The result of request.getPathInfo is based on the servlet-mapping for the 
resulting servlet.  It has nothing to do with the filter-mapping.