@Provider public class AcceptHeaderJerseyMvcFilter extends Object implements com.sun.jersey.spi.container.ContainerRequestFilter
This is a filter to "fix" user agents with broken Accept headers.
When a client accepts text/html we want it to be first in the header. This is because, it is likely that it is a browser and we then
believe that HTML is the best view to render.
This was introduced specifically to make Jersey MVC work with
webkit based browsers which by default have their accept header set to application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*\/*;q=0.5
The "fix" is to prepend text/html content type in the Accept header if it exists anywhere (else)
in the header.
When a client accepts MediaType.WILDCARD (IE) we want to prepend it with text/html.
| Constructor and Description |
|---|
AcceptHeaderJerseyMvcFilter() |
| Modifier and Type | Method and Description |
|---|---|
com.sun.jersey.spi.container.ContainerRequest |
filter(com.sun.jersey.spi.container.ContainerRequest request) |
Copyright © 2016 Atlassian. All rights reserved.