users@jersey.java.net

Re: [Jersey] Access to client side MessageBodyReader

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 23 Feb 2010 10:25:03 -0500

On Feb 23, 2010, at 8:32 AM, Jan Algermissen wrote:
>
> is there a way to access the selected MessageBodyReader on the client side? What I need to do is to set some information at construction time or later.
>
You might be able to do what you want with a ContextResolver:

https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/ext/ContextResolver.html

The message body reader can obtain the application-supplied context using:

https://jsr311.dev.java.net/nonav/releases/1.0/javax/ws/rs/ext/Providers.html#getContextResolver(java.lang.Class,%20javax.ws.rs.core.MediaType)

Marc.