I have a feeling that the spec of JAX-RS is kind of weak on exception
handling. It regulates a lot of tags for matching a method to handle a
request based on path, consume, provide, ... But once an exception happen,
all these mechanism are gone. I have to judge what kind of content to return
in the method toResonse(Throwable...) based on very little information
available.

Rice

On Thu, Jun 2, 2011 at 5:32 PM, Rice Yeh <[email protected]> wrote:

> Hi,
>   I write a ExceptionMapper to handle exception. In the ExceptionMapper, I
> have a need to know the matched response type to return different response.
> For example, if the the matched response type is html, it returns a html
> response and if the matched response is  json, it returns json. How do I do
> this?
>
> Regards,
> Rice
>

Reply via email to