ContainerResponseFilter not working

前端 未结 1 1853
生来不讨喜
生来不讨喜 2020-12-19 04:49

In wildfly 8.1 with REST services, I wanted to implement CORS ContainerRequestFilter and ContainerResponseFilter.

My request filter is working properly but Con

相关标签:
1条回答
  • 2020-12-19 05:25

    You are mixing ContainerRequestFilter and ContainerResponseFilter in your question. As you want to send additional Headers to the client the ContainerResponseFilter is the right one.

    The @PreMatching annotation can be applied to a ContainerRequestFilter "to indicate that such filter should be applied globally on all resources in the application before the actual resource matching occurs".

    Adding it to a ContainerResponseFilter does not make sense. Just remove the annotation and your filter should work.

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