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

Last updated on JUNE 09, 2016

Applies to:

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

Symptoms

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: https://issues.apache.org/bugzilla/show_bug.cgi?id=54277

Therefore, WebLogic is doing it incorrectly.

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms