File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring MVC AOP Logger Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
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://aspose.com/file-tools
 
subject: Spring MVC AOP Logger