Greetings, The following code at ServerResource#doHandle(AnnotationInfo ,Variant ) seems backwards perhaps. (2.0m3snapshot)
if (resultObject != null) { // TODO This is a shortcut in case the resource does not // precise the media-type of the representation. This should be // enhanced, maybe with a media type "unknown" for the // negotiated variant. if (resultObject instanceof Representation) { result = (Representation) resultObject; if (variant.getCharacterSet() != null) { result.setCharacterSet(variant.getCharacterSet()); } else if (variant.getMediaType() != null) { result.setMediaType(variant.getMediaType()); } else if ((variant.getLanguages() != null) && !variant.getLanguages().isEmpty()) { result.setLanguages(variant.getLanguages()); } else if ((variant.getEncodings() != null) && !variant.getEncodings().isEmpty()) { result.setEncodings(variant.getEncodings()); } } else { result = cs.toRepresentation(resultObject, variant, this); } } So what is the purpose of this code and were the Else-If's the intended logic? The "variant" variable is ultimately from the ClientInfo.getPreferredVariant and such if we are testing for Representations that don't have variant "stuff" set then testing the client preferred variant being set for these things doesn't seem the right direction to take. The else if's make these checks short circuit if one is true, why is that? Currently if you use a @Get() annotation with no extention value or "" this bit of code will get your representation's media type overwritten with some other media type. When I use riap via a getClientDispatcher it overwrites it with 'application/json' but normally it does it with 'application/xml'. Sincerely, Joe Nellis ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2375593