4567891011@Pointcut("execution(@org.springframework.web.bind.annotation.RequestMapping * *(..))") public void controllerPointcut() {} @Around("controllerPointcut()") public Object controllerAround(ProceedingJoinPoint joinPoint) throws Throwable { //方法实现。。。 }
Spring都配置好文件后,启动。上面代码会自动读取含有RequestMapping标签[任意返回值,任意方法,任意参数]的方法,执行你的“方法实现”