users@jersey.java.net

Re: [Jersey] Configuring Exception Handling

From: Stephen Duncan Jr <stephen.duncan_at_gmail.com>
Date: Thu, 17 Sep 2009 13:32:27 -0400

Ok, I spoke too soon. I wrote my ExceptionMapper as
ExceptionMapper<Throwable>, since I wanted it to be the fallback. But it
goes too far; now I don't get the default Jersey behavior of 404 when URLs
don't match, etc. Instead I get my 500 error. I'm not sure how to replace
just the old 500 error behavior. Should I be looking at a servlet filter or
some other technique instead?

-Stephen

On Wed, Sep 16, 2009 at 4:02 PM, Stephen Duncan Jr <stephen.duncan_at_gmail.com
> wrote:

> Thanks, that worked perfectly.
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>
>
> On Wed, Sep 16, 2009 at 2:35 PM, Marc Hadley <Marc.Hadley_at_sun.com> wrote:
>
>> Sounds like the standard ExceptionMapper will do what you want:
>>
>>
>> https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/ext/ExceptionMapper.html
>> https://jsr311.dev.java.net/nonav/releases/1.0/spec/
>> spec3.html#x3-510004.4
>>
>> Marc.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>>


-- 
Stephen Duncan Jr
www.stephenduncanjr.com