1

I am using Jersey and Tomcat to create a RESTful API.

I want to apply a CustomContainerRequestFilter (which implements ContainerRequestFilter) to each request.

So I've added

<init-param>
        <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
        <param-value>com.CustomContainerRequestFilter</param-value>
</init-param>

The problem is that the implementation of filter() method is not triggered at all although the CustomContainerRequestFilter is being instantiated after deployment.

Did I forget to do something in order that filter to get called on each Rest method?

1
  • Hello, you should add more of your web.xml file and show us your CustomContainerRequestFilter, that would help to help.
    – Ulflander
    Feb 14, 2013 at 10:45

1 Answer 1

1

Make sure you annotate your ContainerRequestFilter implementation with a @Provider annotation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.