You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by Reto Bachmann-Gmür <re...@apache.org> on 2011/10/04 11:47:28 UTC

Response Media Type and MBW

Hello,

I'm having a problem with content negotiation and MessageBodyWriters.

If my resource method has no @Produces annotation (or the equivalent
@Produces("*/*") and I request the resource with the accept header set
to text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
(firefox default) my message body writer that supports various rdf
formats (thus matching */*) isn't used and an HTTP 500 response is
answered.

If I set my accept header to a concrete rdf type or if I add an
@Produces annotation to the resource method the message body writer is
used correctly.

It seems that wink determines the media-type before looking at the
available MessageBodyWriters. Is there a particular reason to pass a
single media-type to FlushResultHandler or could we pass all
mediatypes (ordered by priority) that are acceptable and that match
the @Produces annotation of the method?

Cheers,
Reto