dev@jersey.java.net

Re: [Jersey] How to get registered filters from inside client filter?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 13 May 2009 11:06:16 +0200

On May 13, 2009, at 1:51 AM, Paul C. Bryan wrote:

> I wish it was that easy. It doesn't seem to be the case for me. :(
>

Pass the instance of Providers obtained from Client to the the
constructor of your filter.

The client API does not perform injection on client filters, since
instances are added to the client filter chains.

Paul.

> On Tue, 2009-05-12 at 16:00 -0400, Marc Hadley wrote:
>> I would imagine you can inject an instance of the Providers interface
>> into a field of your filter like this:
>>
>> public class MyFilter ... {
>>
>> @Context javax.ws.rs.ext.Providers p;
>>
>> ...
>> }
>>
>> You can then use the Providers instance to lookup a MessageBodyWriter
>> or whatever else you need.
>>
>> HTH,
>> Marc.
>>
>> On May 12, 2009, at 3:17 PM, Paul C. Bryan wrote:
>>
>>> Is there an easy way to get the registered providers from within a
>>> client filter?
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>