users@jersey.java.net

[Jersey] Re: FeaturesAndProperties - FEATURE_XMLROOTELEMENT_PROCESSING

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 06 Mar 2012 07:28:13 +0100

Hello,

I guess you don't have @XmlRootElements name property set. All it does
is that it takes it into account, so

     @XmlRootElement(name="Elem")
     public static class Element {
         public String str;

         public Element() {}
         public Element(String str) {this.str = str;}
     }

this class when returned as a list will be returned in wrapping element
called "Elems" (not "elements" as it would be without activation of this
feature).

Feel free to ask additional questions if any.

Regards,
Pavel

On 3/3/12 1:47 AM, chriso wrote:
> Referring to this post:
> http://jersey.576304.n2.nabble.com/Pluralization-again-td5369791.html
> and this:
> http://jersey.576304.n2.nabble.com/XmlRootElement-and-plurals-td4666686.html#a5941014
>
> I have set this init-param, but it's not affecting the output, i.e., I still
> get this:
>
> <segmentBeans>
> <segment/>
> </segmentBeans>
>
> On a related note, can someone tell me if I am setting this correctly? I
> simply did as Paul said and set it in Tomcat's web.xml as an init-param. I
> have no idea how to use the FeaturesAndProperties interface, and its
> FEATURE_XMLROOTELEMENT_PROCESSING field. I can't find any
> examples/documentation anywhere.
>
> Thanks for any help.
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/FeaturesAndProperties-FEATURE-XMLROOTELEMENT-PROCESSING-tp7338560p7338560.html
> Sent from the Jersey mailing list archive at Nabble.com.
>