• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Intercepting Jersey Resource Methods with Spring aop

 
Rj Ewing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use spring aop to intercept my jersey resource methods. I want to implement api versioning, where I transform the request to the latest version, do some work in the resource method, and then transform the response to the requested api version.

I am using spring and jersey currently. I tried to use spring aop to intercept the jersey resource methods, and at first glance it appeared to be working. However, I noticed 1 problem.

Anything injected into the RootResource class via jersey (Ex. @Context HttpHeaders) is null when using spring aop. It is null both in the advice method as well as the resource method. When I disable aop, the properties are injected properly and accessable in the resource method.

Any ideas on what is happening and how to fix it?





 
Rj Ewing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so it looks like this is a bug in jersey-spring3. https://java.net/jira/browse/JERSEY-3126?jql=text%20~%20%22spring%20aop%22
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic