Hi guys, Fabio has uploaded a small reproducible test case:
"Issue with content-negotiation and JAX-RS" http://restlet.tigris.org/issues/show_bug.cgi?id=730 My feeling is that this should be fixed in the next 1.1.3 release which is about one month away. Would that be good for you Fabio and feasible for you Stephan? Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -----Message d'origine----- De : Stephan Koops [mailto:[email protected]] Envoyé : vendredi 13 février 2009 16:29 À : [email protected] Objet : Re: JAX-RS and media types Hi Fabio, this is definitvly a bug. Do you need a quick fix, or does it have time? best regards Stephan > Dear all, > > I am playing with the Restlet JAX-RS extension and I have a question to ask > about media types. > > I defined two MessageBodyWriter for MyType, one annotated with > @Produces("text/xml") and the other with @Produces("text/plain"). > > Now the problem is that when Safari asks for a resource that gives a > representation of MyType using the following header: > > Accept: > text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > > The text/plain representation is returned. > > Actually the returned representation varies randomly at each server restart. > Sometimes the text/xml is returned. I suspect that this is due by the fact > that providers are put in a Set returned by the getClasses() method, where > the order is not taken into account. > > Anyway I would have expected that with such an Accept header, the text/xml > would have always been returned and I don't understand why, being a text/xml > writer available, the text/plain is selected. > > Any idea? > > Thank you, > Fabio > > P.S.: If I use simpler Accept headers, everything works fine: "Accept: > text/plain" -> returns text/plain. "Accept: text/xml" -> returns text/xml. _______________________________________________________________________ Jetzt 1 Monat kostenlos! WEB.DE FreeDSL - Telefonanschluss + DSL für nur 17,95 EURO/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K15039B7069a ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1151446 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1177324

