cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Accept header no longer read for selecting WriterInterceptor
Date Thu, 08 Jan 2015 18:51:52 GMT
Hi

The response content type is determined early now when a resource method 
is selected and it is the intersection between Accept and @Produces

Perhaps you need to introduce some qs qualifiers to make the 
intersection more deterministic ?

Can you provide more info please ? The method signature, the actual 
Accept value (with all the 'q' qualifiers) ?

Thanks, Sergey

On 08/01/15 18:06, Unico Hommes wrote:
> I have been upgrading my application from CXF 2.6 to 3.0 and
> encountered a difference to the way JAXRSOutInterceptor selects a
> WriterInterceptor to serialize a message based on the Accept header.
> It used to be that if you sent a request with an Accept header of
> text/html,application/xhtml+xml,application/xml (like a regular
> browser does), a WriterInterceptor would be selected based on that [1]
> if no Content-Type header was sent along. But in 3.0 this is no longer
> the case, only the Content-Type header is used [2]. The problem is
> that when I now want to browse my REST service I get a server error
> instead of the xml output I was expecting. This is because my browser
> does not send a Content-Type header but only an Accept header. Was
> this a change required by the spec or is this a bug?
>
> Regards,
> Unico
>
> 1. http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cxf/cxf-bundle/2.6.16/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java#JAXRSOutInterceptor.computeAvailableContentTypes%28org.apache.cxf.message.Message%2Cjavax.ws.rs.core.Response%29
>
> 2. http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cxf/cxf-rt-frontend-jaxrs/3.0.2/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java#213
>


Mime
View raw message