users@jersey.java.net

Re: [Jersey] how to catch 405 errors.

From: Diego Gil <diego.a.gil_at_gmail.com>
Date: Wed, 21 Apr 2010 12:35:29 -0300

Maybe the only thing we are missing is the registration of our
ExceptionMapper implementation, but I couldn't find how to do it.

Any hint ?.

Ragards,
Diego.


On Wed, 2010-04-21 at 16:51 +0200, Paul Sandoz wrote:
> Hi Diego,
>
> Some questions:
>
> 1) What version of Jersey are you using?
>
> 2) Are you deploying as a servlet?
>
> When you say custom format do you mean returning some HTML as response
> entity or some XML or JSON?
>
> You can use an exception mapper for WebApplicatio, check the Response
> from that exception and then create a new response as appropriate or
> return the existing response.
>
> Paul.
>
> On Apr 21, 2010, at 4:43 PM, Diego Gil wrote:
>
> > Hi,
> >
> > We are developing a small web services repository with Jersey and
> > facing
> > now a little issue with error messages.
> >
> > If the client makes a wrong request, calling a non existing method due
> > to a typo, gets a 405 response. That is ok but we would like to catch
> > this exception to use a custom format.
> >
> > There is any example of that ?.
> >
> > We should use ExceptionMapper or there is another hook to catch that
> > early errors?
> >
> > Thanks,
> > Diego.
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> > For additional commands, e-mail: users-help_at_jersey.dev.java.net
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>