JAX-RS (Jersey 2 implementation) content negotiation with URL extension .xml or .json
问题 I've seen a Java RESTFUL webservice, that allowed the content-type to be requested in the URL with an extension at the end, such as .xml .json This is the style of content negotiation I am striving to achieve in my own Web Service. I am aware of the @Produces annotation, and the fact a method can resolve multiple types with the (value = {}) syntax, by adding an Accept header, say with Postman, the Chrome extension. But I'm not sure how to effectively extract out the information in one method,