users@jersey.java.net

[Jersey] Re: How to catch the response in case of an invalid query paramter

From: lasloo <lasloo_at_gmail.com>
Date: Tue, 10 May 2011 09:12:18 -0700 (PDT)

To get the default behavior, I would just put in the 'else' section
something like:

WebApplicationExceptionMapper defaultExceptionMapper = new
WebApplicationExceptionMapper();
return defaulExceptionMapper.toResponse(ex);

I'm using CXF's JAXRS, so their default is:
org.apache.cxf.jaxrs.impl.WebApplicationExceptionMaper

This may be different for other JAXRS implementations... but figure out what
it is and do something similar.


--
View this message in context: http://jersey.576304.n2.nabble.com/How-to-catch-the-response-in-case-of-an-invalid-query-paramter-tp6272285p6348497.html
Sent from the Jersey mailing list archive at Nabble.com.