I am new to AOP.
I have a controller class, ChangePasswordController , that extends an abstract Controller class which in turn extends AbstractWizardFormController. My requirement is to write an advice against the methods in ChangePasswordController, so that whenever any exception is thrown from the controller, it should come to my Advice class.
I have written the following code in the configuration file,
I tried with before and after advices also, but control is not coming to my advice.Code:<aop:aspectj-autoproxy proxy-target-class="true"/> <bean id = "handleBeforeExceptionResolver" class = "com.a.c.exception.HandleBeforeExceptionResolverAdvice"/> <aop:config> <aop:aspect ref="handleBeforeExceptionResolver"> <aop:pointcut id="pointcutExceptionLog" expression="execution(* com.a.b.ChangePasswordController.*(..))" /> <aop:after-throwing method="afterThrowingException" pointcut-ref="pointcutExceptionLog" throwing="exception" /> </aop:aspect> </aop:config>
I guess the proxy is created using CGLIB. Please let me know if I am doing anything wrong.
Any pointers are welcome.
Thanks in Advance,