In JAX RS, differences between returning Response and Bean or Collection of Beans (DTO)
问题 I am working on building a REST api. My question is, when using Jersey, what are the differences between my services building and returning a Response object or returning the the bean or collection. I am only concerned with successful calls, I am throwing appropriate exceptions for errors and exceptional situations. Here is a example: @Produces(MediaType.APPLICATION_JSON) public Response search(FooBean foo){ List<FooBean> results = bar.search(foo); return Response.ok(results).build(); } vs.