users@jersey.java.net

[Jersey] Re: Marshal XML using Jackson

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Thu, 19 May 2011 17:39:05 +0200

Hello Tristan,

just implement MessageBodyReader/Writer and put @Provider annotation on
that class. (You probably know that).

User supplied providers have priority over jersey ones, to it should be
really simple. Do you have some simple testcase which shows that your
provider is not taken into account? Or can you at least share your
provider (I don't need methods implementation)?

Thanks,
Pavel

On 5/19/11 4:23 PM, Tristan Wehrmaker wrote:
> Hi!
>
> It might seem a little silly but I'm looking for a way to use Jackson
> to (un)marshall xml.
>
> With the POJOMappingFeature it's possible to marshal JSON using Jaxb
> annotations but without using Jaxb itself, which gives me really nice
> results.
> So when I found an extension for Jackson, which allows to marshal XML
> using Jackson (https://github.com/FasterXML/jackson-xml-databind), I
> thought it would be nice to see what results this would produce and if
> they would better suit my needs over Jaxb.
>
> My question is now, what is the best way to write a provider for
> application/xml thats using Jacksons XML databinding. In my attempts
> my provider get's ignored and the Jaxb provider is used.
>
> Regards
> Tristan
>