This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring MVC AOP Logger Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Spring MVC AOP Logger" Watch "Spring MVC AOP Logger" New topic
Author

Spring MVC AOP Logger

Matt Thomassan
Ranch Hand

Joined: Dec 23, 2008
Posts: 44
Hello Ranchers,

I have successfully implemented AOP in a basic (non-MVC) Spring application.

But now I want to implement AOP in Spring MVC.

1) Here is the controller
AddEmployeeSimpleFormController


2) Here is the advisor class i.e. aspects class
LogAspects.java


3) Here is the main XML file:
springmvc-servlet.xml


The problem is whenever onSubmit() of the controller runs, all the aspects of LogAspects.java are not running.

I am unable to figure out the problem.

Please give me any pointers.

Thank You.

Best Regards
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Where's the aspect bean definition?
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Spring AOP is proxy-based it will not work with onSubmit.

It works only with handleRequest (since version that it's not final).


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Spring MVC AOP Logger
 
Similar Threads
Hello world spring aop
Problem with Spring AOP
Spring AOP question
Spring AOP program not running as expected
Spring 2.5 and AOP - BeanPostProcessor before instantiation of bean failed