定义了一个IOC,通过app.xml进行bean定义。
在主程序类添加@EnableAspectJAutoProxy
定义切面类,添加@Aspect,@Component
定义切面方法添加@Before(".....")
执行代码,不进入切面。
需要在app.xml中添加<aop:aspectj-autoproxy proxy-taret-class="true"/>
app.xml定义中添加xmlns:aop="http://www.springframework.org/schema/aop"
在xsi:schemaLocation中添加http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
并且需要定义切面类的bean,<bean id="" class=""/>