How can you pass data from a Filter to the endpoint in Jersey

后端 未结 1 569
时光说笑
时光说笑 2021-01-20 12:39

Can you pass some data from a javax.servlet.Filter to a Jersey endpoint without using ThreadLocal or HttpSession?

And because the first question will be \"why do you

相关标签:
1条回答
  • 2021-01-20 13:14

    Try injecting with @Context. I'm not sure what object you will receive though (somewhere I saw WebServiceContext, which is jax-ws), but it should contain the HttpServletRequest. so you will be a able to set request attributes in the filter and read them in the rest service

    0 讨论(0)
提交回复
热议问题