• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 Dynamic Method Invocation

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have an action definition as follows:



I also have the method implemented in the meetUpAction class which the Spring framework will inject. When I call this action I get the following error!


Is it because of the dynamic proxy thing? Does my getArchiveMeetUpList() needed to be declared in an interface so that it is visible for the dynamic proxy class? Guidance needed!
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Allright. Figured this one out. It was due to the Spring AOP proxy issue. Spring by default uses JDK dynamic proxy which means it would proxy the interface by implementing it. But for my case in my action class I need to execute a method (dynamic method invocation) by calling my action class. But at the same time I do not want to create an interface for my action class and just add this method there. So changed my applicationContxt.xml entry from:



to



and it worked. Now it makes use of CGLIB proxies.

But another question. Do I loose any performance gain here? Also CGLIB proxies do not allow my class that I'm AOP controlling to be declared as final which is already a shit for me. Any suggestions here on what could be the ideal way. I mean I prefer to use JDK dynamic proxy and at the same time I want to use Dynamic Method Invocation in Struts and at the same time I do not want to add an extra interface to avoid the proxy method not found exception.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ended up adding an interface to my action class. Any other suggestions?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic