users@jersey.java.net

[Jersey] Re: Add attributes to Jersey Client Requests

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Wed, 30 Oct 2013 20:04:04 -0400

On 30/10/2013 7:52 PM, Eric Stein wrote:
> I'm trying to do some testing using the Jersey client. I would like to put an attribute into the request, but I don't see any way to do that in the documentation or the javadocs. An internet search was less than helpful. Is this possible?
>
> Thanks,
> Eric

     What do you mean by "attribute"? Are you trying to set a value to
be returned by ServletRequest.getAttribute()? If so, you cannot pass
such values directly from client to server. These attributes must be set
on the server side (perhaps using a request filter). One approach would
be to pass HTTP headers from the client to server, intercept them in the
request filter and pass them into the ServletRequest.setAttribute().

Gili