要使用spring中自带的面向切面的实现,需要在spring四个基础的依赖上在加两个:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
一般切面:对目标类中所有方法进行拦截