Top Description Methods
javax.ws.rs.container

public Interface ContainerResponseFilter

Imports
java.io.IOException

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 a resource or sub-resource method AND the method or the whole custom JAX-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 bound dynamically to particular resource methods.

Authors
Marek Potociar, Santiago Pericas-Geertsen
Since
2.0
See Also
javax.ws.rs.container.ContainerRequestFilter

Method Summary

Modifier and TypeMethod and Description
public void
filter(ContainerRequestContext
request context.
requestContext
,
ContainerResponseContext
response context.
responseContext
)

Filter method called after a response has been provided for a request (either by a request filter or by a matched resource method.

Method Detail

filterback to summary
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException

Filter method called after a response has been provided for a request (either by a request 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:ContainerRequestContext

request context.

responseContext:ContainerResponseContext

response context.

Exceptions
IOException:
if an I/O exception occurs.