users@jersey.java.net

[Jersey] how can I get json and xml result

From: <everhow_at_163.com>
Date: Fri, 14 Jun 2013 10:31:09 +0000 (UTC)

I can defined method with @Produces annotations, but how can I get
differenent result, eg, json and xml.

        @GET
        @Path("/registerUser")
        @Produces({ MediaType.APPLICATION_JSON,
MediaType.APPLICATION_XML })
        public String registerUser(@QueryParam("deviceId") String
deviceId){...}