users@jersey.java.net

[Jersey] Re: Does filter method of ContainerRequestFilter run in resource method thread?

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Fri, 5 Sep 2014 18:03:35 +0200

In general, the answer is "No". Why don't you just inject HttpHeaders into your resource method?

Marek

On 04 Sep 2014, at 14:40, 鲍明礼 <mingli.bao_at_yolu-inc.com> wrote:

> Hi, all.
>
> I get user info from request header in filter method of ContainerRequestFilter , and save it to ThreadLocal variable so I can get it in resource method. But I wonder if this is OK ? Will resource method run in the same thread as filter method in ContainerRequestFilter ?
>
> Thanks.
>
>
> --
> Best Regards
> 鲍明礼
> ---------------------------------
> 微人脉
> 邮件: mingli.bao_at_yolu-inc.com
> 地址: 北京市东城区新中西里13号巨石大厦西区5层
> 邮编: 100027
>
>
>
>