I could not find a way to change the root element of XML generated when a collection is returned ( without writing custom message writers).
e.g.
/*Bean */
@XmlRootElement(name="customer")
public class CustomerBean
{
public int id = 10;
public String name = "John";
}
/*REST Resource */
public Collection< CustomerBean > test()
{
return Collections.singletonList(new CustomerBean ());
}
/*Generated XML */
<customerBeans> -- I thought the root element will be 'customers', is it a JAXB stuff?
<customer>
<id>10</id>
<name>John</name>
</customer>
</customerBeans>
Herak