<aop:config>
<aop:aspect ref="aopCheck">
<aop:pointcut id="target" expression="execution(* com.dlb.frame.test.aop.Common.excute())" />
<aop:before method="checkUser" pointcut-ref="target" />
<aop:after method="addUserLog" pointcut-ref="target" />
</aop:aspect>
</aop:config>
```
```
public class Common{
public void execute() {
System.out.println("--普通类--");
}
}
public class AopCheck {
public void checkUser() {
System.out.println("--check User--");
}
public void addUserLog() {
System.out.println("--addUserLog--");
}
}
public class TestAop {
public static void main(String[] args) {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
Common common = (Common) applicationContext.getBean("common");
common.execute();
}
}
六月 15, 2017 3:12:23 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from file [D:\workspace\eclipse\my\build\classes\spring-beans.xml]
--普通类--
就是没有反应怎么回事啊,也没有报错