Hi
On 10/07/12 03:14, javakurious wrote:
I have a cxfrs component which is handling http requests. My simple question
is how do I set a cookie in the response, so that it is sent back to me with
subsequent requests from the same client ?
Another question on related topic is, how can I access the cookie values
from a simple java bean ?
It might be a bit off topic for the camel users list, you will be
welcome on the cxf list with such questions.
To get a cookie returned use a JAX-RS Response class and set a new
cookie on it with either an explicit "Set-Cookie" header or NewCookie
utility class - the latter is usable but is a bit limited at the moment,
specifically, no Expires property can be set on it.
The easiest way to get the cookie in the code is to use a @CookieParam
annotation on a specific method parameter. Alternatively get
@HttpHeaders context injected or passed as a method parameter and get
the cookies from it
HTH
Sergey
Any help is appreciated.
Thanks
--
View this message in context:
http://camel.465427.n5.nabble.com/camel-cxfrs-setting-a-cookie-in-the-http-response-tp5715788.html
Sent from the Camel - Users mailing list archive at Nabble.com.