问答详情
源自:2-1 使用AOP处理请求(上)

aop不生效。。很奇怪

@Aspect

@Component

public class HttpAspect {


@Pointcut(value = "execution(public * com.eric.demo.api.user.controller.UserController.*(..))")

public void log(){

}

@Before(value = "log()")  

 public void doBefore(JoinPoint joinPoint){

      System.out.println("11111111111");

   }

}


提问者:慕哥5666153 2018-01-18 17:21

个回答

  • CrazyB
    2018-01-18 20:34:51

    @Before(value="log()")写成@Before("log()")