-
public interface ContainerResponseFilter
An extension interface implemented by container response filters.By default, i.e. if no
name binding
is applied to the filter implementation class, the filter instance is applied globally to any outgoing response. If there is a@NameBinding
annotation 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 method
AND the method or the whole customJAX-RS Application
class 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
@Provider
to be discovered by the JAX-RS runtime. Container response filter instances may also be discovered and bounddynamically
to 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 and Description void
filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
Filter method called after a response has been provided for a request (either by arequest filter
or 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 filter
or by a matched resource method.Filters in the filter chain are ordered according to their
javax.annotation.Priority
class-level annotation value.- Parameters:
requestContext
- request context.responseContext
- response context.- Throws:
IOException
- if an I/O exception occurs.
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ws/rs/container/containerresponsefilter.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.