users@jersey.java.net

Re: [Jersey] Reprocess xml generated

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 18 Sep 2009 16:40:11 -0400

On Sep 18, 2009, at 3:34 AM, bea wrote:
>
> I've a method with a @GET annotation, that produces json and xml
> formats, and returns an object with JAXB annotations. I'd like to
> know if it's possible to post-process the xml generated before it is
> send to the client, I mean, I'd like to use a post-method in order
> to parser the xml generated.
>
One approach would be to write your own MessageBodyWriter that either
replaces or wraps the regular JAXB one. Alternatively you could do the
JAXB marshalling in your method code and call the post-process method
before returning the resulting XML directly.

Marc.