tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49098] New: Filter not invoked when <location> of <error-page> contains querystring
Date Mon, 12 Apr 2010 16:17:09 GMT
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.munafo@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message