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
posted Jun 27, 2009 07:11:05
0
Where's the aspect bean definition?
Hong Anderson
Ranch Hand
Joined: Jul 05, 2005
Posts: 1936
posted Jun 27, 2009 11:37:19
0
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
subject: Spring MVC AOP Logger