3 After throwing advice:
After throwing advice executes when a matched method execution exits by throwing
an exception. It is declared inside an <aop:aspect> using the after-throwing
element:
<aop:aspect id="afterThrowingExample" ref="loginAspect">
<aop:after-throwing
pointcut-ref="businessService"
throwing="ex"
method="logRequiredTask"/>
...
</aop:aspect>
The logRequiredTask method must declare a parameter named ex. For example, the method signature may be declared as:
public void logRequiredTask(DataAccessException ex) {...