0

With reference to the question asked in [What is the proper replacement of the Resteasy 3.X PreProcessInterceptor?

I have a similar kind of requirement, where iam upgrading from RestEasy2.x to restEasy3.x. Server used is Wildfly 8.1 and Java 1.7. I have a preprocessorInterceptor class which is called before invoking any Rest method to do some session manipulation and to add some values to httpsession. As this preProcessorInterceptor is deprcated, i treid using the ContainerRequestFilter as explained in this post. But my question is, is Filter a replacement for Interceptor..? When i used filter, my filters are not called and because of that iam getting Duplicate headers received from serve. Can anyone suggest me how to replace the Interceptor in RestEasy3.x.?I tried by removing the @ServerInterceptor as well but still it is not getting called.

Any help will be appreciated

Regards Arun

Community
  • 1
  • 1
arun_kk
  • 382
  • 2
  • 5
  • 14

1 Answers1

3

You don't nee the @ServerInterceptor annotation but as the documentation points out:

Filters implementing this interface must be annotated with @Provider to be discovered by the JAX-RS runtime.

Unrelated: Typically you don't need a session when implementing RESTful application but this is already discussed here.

Community
  • 1
  • 1
lefloh
  • 10,653
  • 3
  • 28
  • 50
  • Thank you for the answer. We where using GZip filters which was getting called before myContainerFilter and that was causing the problem. **@Context HttpRequest** will give the request for that particular session – arun_kk Sep 22 '14 at 08:05