我有一个 Spring Boot 应用程序,我想记录一些信息,当调用 Controller 方法 id 时会发生什么。
出于某种原因,我的 Aspect 无法正常工作。
这是我用@Aspect 注释的@Component 类:
@Pointcut("within(@org.springframework.stereotype.Controller *)")
public void controller() {
}
@Pointcut("execution(* *.*(..))")
protected void allMethod() {
}
@Before("controller()&& allMethod()")
public void logBefore(JoinPoint joinPoint) {
}
当使用 REST 调用任何 Controller 方法时,不会调用 logBefore 方法。
皈依舞
慕田峪4524236
蛊毒传说
随时随地看视频慕课网APP
相关分类