使用spring注解方式实现AOP(一)
业务bean:
?
在spring3中,没有提供实现AOP注解以及cglib的jar包,因此需要自己手动下载以下jar包:
aspectjrt.jar、aspectjweaver.jar、aopalliance.jar、cglib-nop.jar
?
一.首先在spring配置文件中配置AOP功能
?二.编写切面类:
public class TestDemo {@Testpublic void test(){ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");TestServiceBean personService = (TestServiceBean) applicationContext.getBean("testService");personService.save();}}/********程序的输出循序为***********/前置通知...进入环绕通知...save...后置通知...最终通知...退出环绕通知...??