File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring MVC AOP Logger" Watch "Spring MVC AOP Logger" New topic

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

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

3) Here is the main XML file:

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

I am unable to figure out the problem.

Please give me any pointers.

Thank You.

Best Regards
David Newton

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:
subject: Spring MVC AOP Logger
jQuery in Action, 3rd edition