I have a Jersey REST service which has endpoints that can return either application/xml or application/json depending on the Accept header. Client applications can certainly set this header and everything works as expected.
For simplicity of sanity checking and browser-based testing, I’m looking for a way to specify the type from the URL. It’s my understanding that Rails has something like this (just append .json to the resource and it automatically selects application/json). Does Jersey have something similar?
Yes. You can set extension to media type mappings in the init parameters of the jersey servlet by setting the com.sun.jersey.config.property.MediaTypeMappings property.