users@jersey.java.net

Re: [Jersey] Re: locale of the request ?

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 21 Sep 2009 08:58:22 -0400

On Sep 19, 2009, at 3:32 AM, Felipe Gaścho wrote:

> I got it, but I have a second question: should I use the @Context
> HttpHeaders as method param or type member ?
>
> @Context HttpHeaders header;
>
> @POST
> public Response insert(@QueryParam("login") String login) {
> ......
> }
>
> ---------- OR:
>
> @POST
> public Response insert(@Context HttpHeaders header,
> @QueryParam("login") String login) {
> ......
> }
>
> ??
>
> is it thread safe to use the @Context as type member ?
>
Either works, the injected instance is thread-local and therefore
thread safe.

Marc.