users@jersey.java.net

Re: [Jersey] Controlling name of outermost tag when returning a list?

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Tue, 6 Oct 2009 10:36:58 -0700

On Tue, Oct 6, 2009 at 9:55 AM, Moises Lejter <moilejter_at_gmail.com> wrote:
> Given this example:
>
> ---cut here---
> @XmlRootElement(name="item")
> public class Value {
>   public int id;
> }
>
> @Path("/list")
> public class Lister {
>   @GET
>   public List<Value> values() {
>     return
>       Collections.singletonList(new Value());
>   }
> }
...
> Is there a way to change that "values" to "items" ?

Maybe create your own list sub-class, annotate with necessary JAXB annotations?

-+ Tatu +-