wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Elman <el...@apache.org>
Subject Re: ExceptionMapper and Media Types
Date Thu, 18 Aug 2011 14:41:09 GMT
Why do you need a pair of ExceptionMappers?
ExceptionMapper returns Response, which can contain an entity.
The entity will be serialized based on the Accept header.

On Thu, Aug 18, 2011 at 5:24 PM, Gino Bustelo <gino@bustelos.com> wrote:

> I'm looking for a way to control the rendering of an exception based
> on the media type. Basically, the same exception can yield an HTML
> payload or a JSON structure based on Accept header. I tried to achieve
> this with a pair of ExceptionMapper subclasses and the @Produces
> annotation. The json mapper is getting call all the times. What am I
> doing wrong? I'm think that I'm left with looking at the accept header
> in the mapper an producing the different response entities.
>

Mime
View raw message