https://issues.apache.org/bugzilla/show_bug.cgi?id=49098

           Summary: Filter not invoked when <location> of <error-page>
                    contains querystring
           Product: Tomcat 6
           Version: 6.0.26
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: filippo.mun...@kion.it


The filter is not invoked with the following web.xml:

  <filter-mapping>
    <filter-name>log</filter-name>
    <url-pattern>*.do</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
  </filter-mapping>

  <servlet-mapping>
    <servlet-name>my-servlet</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

  <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/error.do?type=generic_error</location>
  </error-page>

Changing <url-pattern> with <servlet-name> the filter is correctly invoked:

  <filter-mapping>
    <filter-name>filter</filter-name>
    <servlet-name>action</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
  </filter-mapping>


The filter is also correctly invoked using <url-pattern> but removing the
querystring from <location>:

  <filter-mapping>
    <filter-name>filter</filter-name>
    <url-pattern>*.do</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
  </filter-mapping>

  <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/error.do</location>
  </error-page>


I have tested with 6.0.26 and 5.5.28.

The problem seems to be in the class
org.apache.catalina.core.ApplicationFilterFactory.java, method matchFiltersURL,
Case 3 - Extension Match.


Filippo

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to