users@jersey.java.net

Re: [Jersey] XSL transform annotation and message body reader/writer

From: Robert Koberg <rob_at_koberg.com>
Date: Fri, 27 Nov 2009 07:16:07 -0800

ufff... my mail client keeps choosing the wrong address to reply (more inline below)


On Nov 26, 2009, at 4:16 PM, Tatu Saloranta wrote:

> On Tue, Nov 24, 2009 at 5:15 AM, Robert Koberg <rob_at_koberg.com> wrote:
>> Hi,
>>
> ...
>> I think that the message body writer would be the most useful as it can output pretty much anything. The main problem being is that it would not be as fast as directly streaming the result.
>
> How so? Message body readers and writers operate on streams, so this
> should not be a problem?

First there is the jaxb parse to the object. Then you use javax.xml.bind.util.JAXBSource
for the transform. The XSL processor will parse that into an internal (optimized) DOM to operate on. In other words, you don't go straight to the output stream, but have an additional parse along the way.


> But they do operate on lower level of abstraction so it would be more
> work to plug those in.
>
> For output you can also use StreamingOutput, which allows for some
> post processing.

Yea, I might need some help it seems :) I was looking at Jackson's JacksonJsonProvider and didn't really understand why you needs to do everything you are doing (the untouchables, unreadables, unwritables). I haven't had a chance to get too deep though.

best,
-Rob



>
> -+ Tatu +-
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>