users@jersey.java.net

[Jersey] default media type for jersey

From: rjilani <jilani_at_lifebiosystems.com>
Date: Wed, 8 Dec 2010 09:29:11 -0800 (PST)

Hi: Gurus, I would like to know what would be the default media type in
jersey if client doesn’t provide one with the client call.

Second what is the best design pattern to return multiple data format on the
basis of the client request call.

E.g lets say I have to return xml, JSON, csv etc formats on the basis of the
call coming from the client like this

http://localhost:8084/Rootcontext/resourceName/{id.xml} //Return xml
http://localhost:8084/Rootcontext/resourceName/{id.json} //Return json
http://localhost:8084/Rootcontext/resourceName/{id.csv} //Return csv

I am not sure how to call different resource methods that produces different
data format

@Produces({MediaType.APPLICATION_JSON})

@Produces({MediaType.APPLICATION_XML})

@Produces({MediaType.TEXT_XML})

Any help would be really appreciated.

Regards,
RJ

-- 
View this message in context: http://jersey.576304.n2.nabble.com/default-media-type-for-jersey-tp5816029p5816029.html
Sent from the Jersey mailing list archive at Nabble.com.