Chapter 58. JAX-RS 2.0 Filters and Interceptors
58.1. Introduction to JAX-RS Filters and Interceptors
MessageBodyReader.readFrommethod invocation (for reader interceptors) or the
MessageBodyWriter.writeTomethod invocation (for writer interceptors).
Server processing pipeline
Figure 58.1. Server-Side Filter and Interceptor Extension Points
Server extension points
PreMatchContainerRequestextension point is reached before resource matching has occurred, so some of the context metadata will not be available at this point.
Client processing pipeline
Figure 58.2. Client-Side Filter and Interceptor Extension Points
Client extension points
Filter and interceptor order
@Priorityannotation in the Java source). A priority is represented as an integer value. In general, a filter with a higher priority number is placed closer to the resource method invocation on the server side; while a filter with a lower priority number is placed closer to the client invocation. In other words, the filters and interceptors acting on a request message are executed in ascending order of priority number; while the filters and interceptors acting on a response message are executed in descending order of priority number.