Jersey Request Filter only on certain URI

后端 未结 3 491
天涯浪人
天涯浪人 2020-12-08 19:40

I am trying to do some validation on requests coming into my service using the ContainerRequestFilter. Everything is working fine, however there is one problem

3条回答
  •  抹茶落季
    2020-12-08 20:22

    @PreMatching does not work together with @NameBinding, because the resource class/method is not yet known in pre-matching phase. I solved this issue by removing @PreMatching from the filter and using binding priority. See ResourceConfig.register(Object component, int bindingPriority).

    Filters to be executed before the resource simply get a higher priority.

提交回复
热议问题