users@jersey.java.net

Content-Type calculation incorrect on 1.0.3

From: Tom Davies <tgdavies_at_gmail.com>
Date: Tue, 20 Jul 2010 14:25:49 +1000

I haven't checked on a more recent version, but on 1.0.3 a resource with the annotation:

@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})

will produce a content type of application/xml given the accepts header text/html,application/xml;q=0.9,*/*

@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})

produces application/json

By my reading of http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 application/xml should end up with a q of 0.9, and application/json a q of 1 after matching */* in both cases.

Tom