Jersey - Passing ContainerRequest headers to a resource
In the above you are setting header values on the Servlet request object. Jersey does not sync between the Servlet request and it's own request.
I recommend you utilize either servlet request attributes or Jersey request attributes rather than add request headers.
Your filter can add Jersey request properties using ContanerRequest.getProperties().
Your resource class can inject HttpContext and obtain the same properties using HttpContext.getProperties.
Read full article from Jersey - Passing ContainerRequest headers to a resource
No comments:
Post a Comment