users@jersey.java.net

Re: [Jersey] Output formatting.

From: Bruno Vernay <brunovern.a_at_gmail.com>
Date: Tue, 19 May 2009 18:49:10 +0200

Thanks, I am looking forward for the new release.

About JAXB I searched for XmlElementWrapper
[https://jaxb.dev.java.net/tutorial/section_6_2_7_7-Wrapping-Repeated-Elements-XmlElementWrapper.html#Wrapping%20Repeated%20Elements:%20XmlElementWrapper]
 But it only works for list.

In the mean time, I just created another class to wrap the first one. It works.

Bruno


>
> I am not sure i understand.
> Do you need to get another root element in addition to what is generated by JAXB?
> I.e. for a xml:
>
> <bean>
>  <name>Jack</name>
> </bean>
>
> which could currently be represented in JSON as:
>
> {"bean":{"name":"Jack"}} or {"name":"Jack"}

YES

>
> would you like to get st. like:
>
> {"root":{"bean":{"name":"Jack"}}}

NO

>
> ?
>