Feb 16th, 2010, 09:53 AM
How to advice spring mvc controllers
I am just wondering if anyone knows of a strategy to advice spring mvc controllers. I know that adding an advice to methods on the controllers will not work because of spring's proxy based aop system. However, if the controllers cannot be adviced directly, how can one address certain cross cutting concerns which crosscut a controller e.g. logging. if anyone can point me in the direction of strategies or threads on this forum which have addressed such issues, I will be very appreciative.
Feb 17th, 2010, 10:22 AM
I have resolved this problem but why it works now, i have no idea. Basically, as I am using Eclipse, I had to convert my project to an AspectJ project i.e. right click project > Configure > Convert to AspectJ Project.
After doing that, it worked but I am still at a loss as to why.
Also, it turns out that you can advice controllers. After doing as described above the advice on the controllers started to work. I read somewhere that you could not apply aspects to spring controllers. Either I was misinformed or I have got something totally wrong. Still miffed