-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
None
-
None
-
None
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/org/glassfish/jersey/filter/LoggingFilter.java
- is related to
-
RESTEASY-1294 Fix ordering comparisons in JaxrsInterceptorRegistry
- Closed