users@jersey.java.net

Re: [Jersey] fastinfoset support

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 18 Jan 2010 11:41:45 +0000

On Jan 18, 2010, at 11:23 AM, Florian Hehlen wrote:

> The work-around is ok although not elegant… it forces me to write a
> lot of extra code.

I absolutely agree.

IIRC the current state of affairs was this may be a bug in FI code.

One possible solution to reduce modification to application code may
be to write a ResourceFilterFactory [1] that adapts the response entity.

The filter would call:

https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/spi/container/ContainerResponse.html
#getEntity%28%29

then wrap that and set it with:

https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/spi/container/ContainerResponse.html
#setEntity%28java.lang.Object%29

Although, in this case one might have to be careful with JAXB contexts.

Paul.

[1] https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/package-summary.html


> I have an existing API with methods that return collections which I
> can not change. So I will have to add special resource methods in
> the resource classes and a lot of per method annotations.
>
> Cheers,
> Florian
>
>
>
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: 18 January, 2010 12:06
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] fastinfoset support
>
> Hi Florian,
>
> On Jan 14, 2010, at 3:21 PM, Florian Hehlen wrote:
>
>
> Hi,
>
> There is an open issue https://jersey.dev.java.net/issues/show_bug.cgi?id=320
> about a fastinfoset incompatibility with collections. Is there any
> known ETA for when this will be fixed?
>
> No, we can try and fix it for 1.1.6 the release after next (6 to 8
> weeks after we release 1.1.5, although it may be earlier depending
> on the OSGi stability). Is that OK for you?
>
>
>
> Are there any workarounds at the moment?
>
>
> The work around is to create a JAXB wrapper bean.
>
> Paul.
>
>
>
> The information in this e-mail is intended only for the person or
> entity to which it is addressed.
>
> It may contain confidential and /or privileged material. If someone
> other than the intended recipient should receive this e-mail, he /
> she shall not be entitled to read, disseminate, disclose or
> duplicate it.
>
> If you receive this e-mail unintentionally, please inform us
> immediately by "reply" and then delete it from your system. Although
> this information has been compiled with great care, neither IMC
> Financial Markets & Asset Management nor any of its related entities
> shall accept any responsibility for any errors, omissions or other
> inaccuracies in this information or for the consequences thereof,
> nor shall it be bound in any way by the contents of this e-mail or
> its attachments. In the event of incomplete or incorrect
> transmission, please return the e-mail to the sender and permanently
> delete this message and any attachments.
>
> Messages and attachments are scanned for all known viruses. Always
> scan attachments before opening them.