Re: signify of {} when i create a rest Response with a List

2016-08-02 Thread Romain Manni-Bucau
@John: GenericEntity is not abstract ;) Personally I use the public constructor to avoid to need to extend it in several places and ensure the dyncamic type is the one I expect whatever impl I use but it needs a Type implementation matching a generic type:

Re: signify of {} when i create a rest Response with a List

2016-08-02 Thread Andy Gumbrecht
Off the top of my head, something like: @Path("apath") @GET @Produces(MediaType.APPLICATION_JSON) public List getWorkshops() {...return a list...} ...client side WebTarget... List workshops = webTarget.request(MediaType.APPLICATION_JSON).get().readEntity(new GenericType() {}); Andy.

Re: signify of {} when i create a rest Response with a List

2016-08-02 Thread mauro2java2011
Esvuse but for instantiation the operator is new () not {} Il 02/ago/2016 02:11, "John D. Ament-2 [via TomEE & OpenEJB]" < ml-node+s979440n4679567...@n4.nabble.com> ha scritto: > GenericEntity is an abstract class. You're instantiating an anonymous > instance of it. > > On Mon, Aug 1, 2016 at

Re: signify of {} when i create a rest Response with a List

2016-08-01 Thread John D. Ament
GenericEntity is an abstract class. You're instantiating an anonymous instance of it. On Mon, Aug 1, 2016 at 8:06 PM mauro2java2011 wrote: > I try to understand how return a collection of object as response with rest > > > > > import javax.ws.rs.core.GenericEntity; >

signify of {} when i create a rest Response with a List

2016-08-01 Thread mauro2java2011
I try to understand how return a collection of object as response with rest import javax.ws.rs.core.GenericEntity; //... @GET public Response workshops() { List workshops = ...//a list of entities GenericEntity> l ist = new