You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/12/11 08:01:49 UTC

[Bug 54277] New: FilterRegistration wrong order

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

            Bug ID: 54277
           Summary: FilterRegistration wrong order
           Product: Tomcat 7
           Version: 7.0.33
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
          Assignee: dev@tomcat.apache.org
          Reporter: psfung@clustertech.com
    Classification: Unclassified

When 2 filters are registered through Servlet 3.0 API,

servletContext.addFilter("A", filterA)
    .addMappingForUrlPatterns(null, false, "*.jsp");

servletContext.addFilter("B", filterB)
    .addMappingForUrlPatterns(null, false, "*.jsp");

Filter B should come before A in the chain, according to the API spec of 2nd
bool param isMatchAfter. In Tomcat 7.0.33, the actual order is reversed. I've
also tested in Jetty 8.1.8, the order is consistent with the spec.

-- 
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


[Bug 54277] FilterRegistration wrong order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

--- Comment #2 from psfung@clustertech.com ---
The fix to bug 53758 is correct for registering 1 filter, but there is still
problem when registering more.

interface org.apache.catalina.Context {

/*Add a filter mapping to this Context before the mappings defined in the
deployment descriptor but after any other mappings added via this method.*/
public void addFilterMapBefore(FilterMap filterMap);

}

But the Servlet spec says
"... to be matched before any declared filter mappings of the
ServletContext..."

-- 
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


[Bug 54277] FilterRegistration wrong order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

--- Comment #4 from psfung@clustertech.com ---
FYI posted in Jetty Bugzilla
https://bugs.eclipse.org/bugs/show_bug.cgi?id=396253

-- 
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


[Bug 54277] FilterRegistration wrong order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
You need to read the all of the Javadoc for
FilterRegistration.Dynamic#addMappingForUrlPatterns(), not just some of it.

1. <quote>Filter mappings are matched in the order in which they were
added.</quote>

2. A declared filter mapping is one that is not created programmatically. i.e.
a declared filter is one defined in web.xml, web-fragment.xml or via
annotations.

-- 
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


[Bug 54277] FilterRegistration wrong order

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> ---
There was a change due to bug 53758. Did it break?
r1377536

It needs a testcase (there seems to be no testcase for bug 53758 in Tomcat
sources either).

-- 
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