|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.server.filter.EncodingFilter
@Priority(value=3000) public final class EncodingFilter
Container filter that supports encoding-based content negotiation. The filter examines what
content encodings are supported by the container (by looking up all the
encoders) and decides what encoding should be chosen
based on the encodings listed in the Accept-Encoding request header and their associated quality values.
If none of the acceptable encodings is supported and identity encoding is explicitly forbidden by the client,
the filter generates Response.Status.NOT_ACCEPTABLE response.
The filter also ensures Accept-Encoding is added to the Vary header, for proper interaction with web caches.
| Constructor Summary | |
|---|---|
EncodingFilter()
|
|
| Method Summary | |
|---|---|
static void |
enableFor(ResourceConfig rc,
Class<? extends ContentEncoder>... encoders)
Enables this filter along with the provided encoders
for the supplied ResourceConfig. |
void |
filter(ContainerRequestContext request,
ContainerResponseContext response)
Filter method called after a response has been provided for a request (either by a request filter or by a
matched resource method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EncodingFilter()
| Method Detail |
|---|
public static void enableFor(ResourceConfig rc,
Class<? extends ContentEncoder>... encoders)
encoders
for the supplied ResourceConfig.
rc - Resource config this filter should be enabled for.
public void filter(ContainerRequestContext request,
ContainerResponseContext response)
throws IOException
ContainerResponseFilterrequest filter or by a
matched resource method.
Filters in the filter chain are ordered according to their javax.annotation.Priority
class-level annotation value.
filter in interface ContainerResponseFilterrequest - request context.response - response context.
IOException - if an I/O exception occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||