I have a Restaasy application that uses Spring and contains ContainerRequestFilter and ContainerResponseFilter implementations annotated with @Provider . The application uses version 3.0-beta-6 Resteasy.
These filters work as expected when they are added to the resteasy.providers context resteasy.providers in web.xml as follows:
<context-param> <param-name>resteasy.providers</param-name> <param-value>foo.filter.LoggingRequestFilter, foo.filter.LoggingResponseFilter</paramvalue> </context-param>
If I remove the filters, they will no longer be called.
I assumed that these providers automatically register with Resteasy when using org.jboss.resteasy.plugins.spring.SpringContextLoaderListener . The strange thing for me is that it worked for PreProcessInterceptor implementations in previous versions of Resteasy and still works in v3, but Filters and ExceptionMappers are not automatically registered.
Questions
- Why is the
resteasy.providers context resteasy.providers needed if classes are annotated with @Provider and scanned with Spring? - Is there a software way to install these providers at runtime?
gregwhitaker
source share