Hi,
When a resource method produces several response types how do you actually
construct each response type?
For example, given:
@GET
@Produces({"application/json", "application/xml"})
public Response doGet(@QueryParam("x") String x) {
}
How do you know if you should construct a response with JSON or plain XML?
Is there any alternative to creating several doGet methods (doGetAsJSON
doGetAsXML, etc...), each with a single @Produces annotation for each return
type?
Thanks.