The method that aop can only intercept GetMapping comments in spring boot

 @Pointcut("execution(public * com.hellobj.tool.data.megersch.controller.Result.*(..))")
    public void webLog(){}
    
    @Before("webLog()")
    public void doBefore(JoinPoint joinPoint) throws Throwable {
        LOGGER.info("=====================Before===================");
     
    }
    
    @After("webLog()")
    public void doAfter()throws Throwable{
        LOGGER.info("=======================After==================");
    }

aop in spring boot can only intercept methods with GetMapping annotations under this class. When methods of the same type are called without GetMapping annotations, messages will not be intercepted.

Mar.18,2021

paste out the Controller code to see that you have to call a method with a proxy object before it can be intercepted by aop. Check to see if it is called by a proxy object.

Menu