Interface ContainerResponseFilter
-
public interface ContainerResponseFilterAn extension interface implemented by container response filters.By default, i.e. if no
name bindingis applied to the filter implementation class, the filter instance is applied globally to any outgoing response. If there is a@NameBindingannotation applied to the filter, the filter will only be executed for a response for which the request has been matched to aresource or sub-resource methodAND the method or the whole customJAX-RS Applicationclass is bound to the same name-binding annotation.Implement a name-bound response filter in cases when you want limit the filter functionality to a matched resource or resource method. In other cases, when the filter should be applied globally to any outgoing response, implement an unbound, global response filter.
Filters implementing this interface must be annotated with
@Providerto be discovered by the JAX-RS runtime. Container response filter instances may also be discovered and bounddynamicallyto particular resource methods.- Since:
- 2.0
- Author:
- Marek Potociar, Santiago Pericas-Geertsen
- See Also:
ContainerRequestFilter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfilter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)Filter method called after a response has been provided for a request (either by arequest filteror by a matched resource method.
-
-
-
Method Detail
-
filter
void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException
Filter method called after a response has been provided for a request (either by arequest filteror by a matched resource method.Filters in the filter chain are ordered according to their
jakarta.annotation.Priorityclass-level annotation value.- Parameters:
requestContext- request context.responseContext- response context.- Throws:
IOException- if an I/O exception occurs.
-
-