users@jersey.java.net

Re: [Jersey] MessageBodyWriter<T>.writeTo change?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 13 Aug 2008 11:41:52 +0200

Hi Daniel,

The media type (content type) passed to the writer should always be the
most acceptable media type.

The code recently change for the case when a resource method does not
declare what is produced i.e. the method or class is not has not
annotated with @Produces. In such a case the content type is determined
from the set of media types associated with the set message body reader
that support for the Java type and the the acceptable media types.

Can you send me some example code of your resource class and your
provider as this will help me determine if there is a bug?

Thanks,
Paul.

Daniel Larsson wrote:
> I recently updated my NetBeans installation, and got a newer jersey
> release (ProduceMime -> Produces, etc). What I've also noticed is a
> change in MessageBodyWriter<T>.writeTo. Previously, the mediaType
> parameter would reflect the request's Accept header value, but since the
> upgrade, I'm getting "application/octet-stream" sent to my provider.
>
> Have I relied on a misfeature until now? (My provider supports multiple
> media types, and used this parameter to pick the requested one)

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109