My Oracle Support Banner

[WLS 12.1.2]Servlet 3.0- AddFilter Adds Filters In Wrong Order (Doc ID 1996257.1)

Last updated on JUNE 02, 2023

Applies to:

Oracle WebLogic Server - Version to [Release 12c]
Information in this document applies to any platform.


When registering multiple filters in a ServletContainerInitializer like below:

context.addFilter("FilterA", new FilterA()).addMappingForUrlPatterns(null, false, "/*");

Where the second parameter (isMatchAfter) is false, filters are added in exactly the opposite order from what the spec states.

When isMatchAfter is false, filters are being added in the opposite order from how they were added. The spec clearly states that they should be added in the same order as they were added. This issue was discussed with a bug in Tomcat and the consensus was that Tomcat is doing it correctly:

Therefore, WebLogic is doing it incorrectly.




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.