欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

springboot aop里的@Pointcut的配置方式-springboot aop里的@Pointcut的配置

最编程 2024-02-10 15:11:40
...
@Pointcut("execution(public * com.wangzhou.newboot.exception.TestExceptionController.test(String,String))")

com.wangzhou.newboot.exception是TestExceptionController类的全路径,test(String,String)是TestExceptionController类下的

test(String s,String d)方法

如果要忽略test方法的入参,所有test方法将被aop

@Pointcut("execution(public * com.wangzhou.newboot.exception.TestExceptionController.test(..))")

如果忽略TestExceptionController的方法,所有TestExceptionController下的方法将被aop

@Pointcut("execution(public * com.wangzhou.newboot.exception.TestExceptionController.*(..))")

如果忽略exception路径下的所有类,不包括exception的子路径

@Pointcut("execution(public * com.wangzhou.newboot.exception.*.*(..))")

如果忽略newboot路径下的所有类,不包括newboot的子路径比如exception里的类,

@Pointcut("execution(public * com.wangzhou.newboot..*.*(..))")