users@jsr311.java.net

Re: Accept and exception mapper response entities

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 05 Mar 2009 09:35:35 -0500

On Mar 5, 2009, at 8:22 AM, Sergey Beryozkin wrote:
>
> Consider this Accept value :
>
> Accept : application/octet-stream
>
>
> Suppose the method being invoked throws a custom exception which is
> then mapped to a response. This response might contain an entity
> which is nor necessarily serializable into an application/octet-
> stream format. For ex, an exception mapper might choose to reply
> with a text/plain message.
>
> In such cases, is it reasonable to expect that the JAXRS runtime
> should serialize such a text/plain message (if the right provider is
> available), despite the fact only application/octet-stream is
> accepted ?
>
Yes. The JAX-RS runtime isn't expected to police the application to
the extent that it would veto a response.

Marc.