Jersey also supports this through the ResourceConfig property PROPERTY_MEDIA_TYPE_MAPPINGS, which you can configure in your web.xml or programmatically through the Jersey API, as shown below:
DefaultResourceConfig rc = new DefaultResourceConfig(MyResource.class);
rc.getMediaTypeMappings().put("json", MediaType.APPLICATION_JSON_TYPE);
rc.getMediaTypeMappings().put("xml", MediaType.APPLICATION_XML_TYPE);
SimpleServerFactory.create("http://localhost:9090", rc);
, .json .xml URL.