users@jersey.java.net

Re: [Jersey] Converter list problem

From: Erdinc Yilmazel <erdinc_at_yilmazel.com>
Date: Sat, 14 Mar 2009 03:19:56 +0000

How is your MyThing class annotated?

On Sat, Mar 14, 2009 at 2:22 AM, Gautam Arora <gautamsarora_at_gatech.edu> wrote:
>
> Hi,
> I have a Converter structure similar to....
>
> @XmlRootElement(name = "things")
> public class MyThingsConverter {
>    private Collection<MyThing> entities;
>    private Collection<MyThingConverter> items;
> .....
> }
>
> @XmlRootElement(name = "thing")
> public class MyThingConverter {
>    private MyThing entity;
> ...
> }
>
> now when i get a response using MyThingsConverter (by returning an object of
> it), my response looks like:
> <things>
>    <MyThing>
>    ....
>    </MyThing>
> </things>
>
> whereas I am expecting it to be:
> <things>
>    <thing>
>    ....
>    </thing>
> </things>
>
> so it seems that the MyThingsConverter is not properly picking up the
> correct XmlRootElement for thing which is defined by me as thing and going
> with the default class name of MyThing.
>
> When I just try to get a reponse from MyThingConverter, I get
> <thing>
> ...
> </thing>
>
> So, the problem seems to be when MyThingsConverter contains a list
> MyThingConverter.
>
> Any flag/setting that I need to enable in such a case?
>
> Thanks,
> Gautam
> --
> View this message in context: http://n2.nabble.com/Converter-list-problem-tp2476841p2476841.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>