Announcement Announcement Module
No announcement yet.
How to advice spring mvc controllers Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to advice spring mvc controllers

    Hi all

    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.


  • #2
    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