首先说下@args定义:
通过判别目标方法运行时入参对象类是否标注特定注解来指定连接点。如@args(com.yuan.advice.args.PrintArgs) 表示任何一个目标方法,如果方法入参类标注了PrintArgs注解,该方法就会被拦截。
配置文件:
spring-args.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"