users@jersey.java.net

Re: [Jersey] Whats the best way to get the raw input before jersey server binds them into java objects

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Thu, 18 Jun 2009 13:36:30 -0700

On Wed, Jun 17, 2009 at 11:24 PM, Paul Sandoz<Paul.Sandoz_at_sun.com> wrote:
>
> On Jun 18, 2009, at 7:56 AM, Tatu Saloranta wrote:
...
>> But what I generally do is to just take in InputStream, and invoke
>> binding explicitly (using JAXB for xml, Jackson for JSON), similar to
>> how I suspect Jersey does. For me the reason to do this is to add some
>> more error handling, as I can add problem listeners to data binders
>> and such.
>
> Are there any aspects to what you are doing that we could make easier?

I have forgotten exact initial reasons, and part may have had to do
with injecting properly configured ObjectMapper (which has since been
resolved in jackson jaxrs provider).

I think the main problem would be that exception handler might not
have enough per-request information to be able to build proper error
response message (i.e. path parameters, or path itself). Back then I
don't think I was aware of ability to define exception handlers so
that may be a non-issue.

-+ Tatu +-