今天主要学习了JDBC的配置,连接,还有传说中神圣的CRUD,也就是增删改查。在不断的实例中,慢慢的对AOP有点理解了,最主要的是了解每个注解是干嘛的,怎么应用,了解之后上手比较快。
其次是在bean中配置AOP,代码如下
<aop:config>
<aop:pointcut expression="execution(* com.yrd.spring.aop.xml.ArithmeticCalculator.*(int,int))" id="pointcut"/>
<aop:aspect ref="loggingAspect" order="2">
<aop:before method="beforeMethod" pointcut-ref="pointcut"/>
<aop:after method="afterMethod" pointcut-ref="pointcut"/>
<aop:after-throwing method="afterMethod" pointcut-ref="pointcut" throwing="e"/>
<aop:after-returning method="afterReturning" pointcut-ref="pointcut" returning= "result"/>
<aop:around method="aroundMethod" pointcut-ref="pointcut"/>
</aop:aspect>
<aop:aspect ref="vlidationAspect" order="1">
<aop:before method="validateArgs" pointcut-ref="pointcut" />
</aop:aspect>
</aop:config>