Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jersey-dev] user guide's chapter-10 MISTAKES

1- example 10.5. GZIP writer interceptor

the "Content-Encoding: gzip" header is not set after compressing the response entity which leads to the following problem:
when a user-agent (ex: chrome) receives the compressed response, it does not know whether the response is compressed or not since that is indicated 
with the presence or absence of the Content-Encoding header.

thus, it assumes that the response entity is NOT compressed and shows the compressed response entity directly without unzipping.

2- quoting from section 10.3 Interceptors of the user's guide

"Similar to methods exposed by WriterInterceptorContext the ReaderInterceptorContext introduces a set of methods for modification of 
request/response properties like HTTP headers, URIs and/or HTTP methods"

URIs and/or HTTP method must not be modified in ReaderInterceptorContext as the resource matching process is done before the execution of ReaderInterceptor(s)
as mentioned in 10.4. Filter and interceptor execution order

3- Example 10.9. Priorities example
quoting from the user guide:

"As this is a response filter and response filters are executed in the reverse order, any other filter with a priority lower than
3000 (Priorities.HEADER_DECORATOR is 3000) will be executed after this filter. So, for example, AUTHENTICATION filter (priority 1000) 
would be run after this filter."

isn't AUTHENTICATION filter a REQUEST filter?
how is it possible that an AUTHENTICATION filter is executed along with response filters?

Back to the top