search

Home  >  Q&A  >  body text

java - Problem about aop not working in controller

I want to intercept the number of accesses to the interface in the controller, but the result is useless. The following is my code

@Component
@Aspect
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class EduAspect {
    private final static Logger LOGGER = LoggerFactory.getLogger(EduAspect.class);
    //我想拦截sample包下所有以.Controller结尾的方法,但是拦截不到
    @Pointcut("execution(* com.sample..*Controller.*(..))")
    public void declareLoggerJoinPointExpression() {

    }

    @Pointcut("@annotation(com.sample.common.annotation.Frequency)")
    public void declareFrequencyJoinPoint(){
        
    }

The code is as above, but aop seems to not work. I also enabled cglib

滿天的星座滿天的星座2702 days ago816

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-06-30 09:58:23

    You haven’t finished writing yet...

    You just declared the entry point. But you didn’t notify the execution.

    For details on how to configure it, please see; http://docs.spring.io/spring/...

    reply
    0
  • Cancelreply