Andreas Redmer created WFLY-5258:
------------------------------------
Summary: Unexpected behavior of negative priorities in container filters
Key: WFLY-5258
URL:
https://issues.jboss.org/browse/WFLY-5258
Project: WildFly
Issue Type: Bug
Components: Web (Undertow)
Affects Versions: 9.0.1.Final
Environment: Windows/Linux
Reporter: Andreas Redmer
Assignee: Stuart Douglas
Priority: Minor
Annotation a class that implements ContainerRequestFilter with
@Priority(Integer.MIN_VALUE) works as expected. The filter is executed first. For
ContainerResponseFilter it is executed in random order.
Priority values should generally be non-negative, with negative values reserved for
special meanings such as "undefined" or "not specified". A
specification that defines use of the Priority annotation may define the range of allowed
priorities and any priority values with special meaning.
In this case the behaviour for negative Priorities is inconsistent between the 2 container
filters. The correct way to work around this is to annotate:
@Priority(0)
Even though: many internet tutorials suggest:
@Priority(Integer.MIN_VALUE)
The implemntation oif logging filter in Glassfish does that too:
https://github.com/jersey/jersey/blob/master/core-common/src/main/java/or...
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)