Marshalling of generic types in Jersey
I need to return to client list of few results and total count of results. I have to do it on several places with different entities so I would like to have a generic class with these two attributes: @XmlRootElement public class QueryResult<T> implements Serializable { private int count; private List<T> result; public QueryResult() { } public void setCount(int count) { this.count = count; } public void setResult(List<T> result) { this.result = result; } public int getCount() { return count; } public List<T> getResult() { return result; } } And the service: @GET @Produces({MediaType.APPLICATION