Unwrap a element in Jackson/Jaxb
问题 I am using Jersey+Jackon to make a REST API which works with JSON. Assume that I have a class as follows: @XmlRootElement public class A { public String s; } and here is my jersey method which uses the class: @GET @Produces(MediaType.APPLICATION_JSON) public Object get(@PathParam("id") String id) throws Exception{ A[] a= new A[2]; a[0] = new A(); a[0].s="abc"; a[1] = new A(); a[1].s="def"; return a; } the out put is: {"a":[{"s":"abc"},{"s":"def"}]} but I want it to be like this: [{"s":"abc"},