users@jersey.java.net

[Jersey] ExceptionMapper and _at_QueryParam Objects

From: Chris Jolley <chris.jolley_at_oracle.com>
Date: Fri, 27 Feb 2009 11:16:38 -0700

I have an @QueryParam Object and am parsing the request param in the
constructor of my object.

Example:

    @Produces({"application/json", "application/xml"})
    public Lists getJsonOrXml(
                              @DefaultValue(DEFAULT_VIEW)
@QueryParam(VIEW_PARAM) ViewParam view)

If the value for my param is malformed I throw a BadRequestException and
I have an ExceptionMapper set up to capture that exception and return a
400. However, the ExceptionMapper never gets invoked. The container
sends back a 404 instead.

Is this by design? Is there a way to change this behavior?