users@jersey.java.net

Re: Content Negociation

From: <amsmota_at_gmail.com>
Date: Wed, 21 Jan 2009 11:22:31 +0000

Ooops, it seems my premiss was wrong, I was testing with a browser instead
of my rest client, and it seems the browser added some stuff, so what I
really have is

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,
application/octet-stream,application/pdf

But the question still ineterest me, how does Jersey handles the situation
I mentioned?

Cheers.




On Jan 21, 2009 11:10am, amsmota_at_gmail.com wrote:
> I searched the archives and although there are many things about conneg
the ones I saw are basically of the type
>
> Accept: xxx/xxx
> @Produces({"application/xml", "application/json"})
>
> But my question is the opposite, in concrete
>
> Accept: application/octet-stream, application/pdf
>
> @Produces("text/html")
> produceHtml()
>
> @Produces("application/pdf")
> producePdf()
>
> I was expecting the producePdf being executed, but I got the html one.
How does Jersey handles situations like this?
>
> Also, does Jersey considers the quality values when matching mime types?
>
>
> Cheers.