王恿老师讲的课中下载了一个spring对AOP的支持采用Annotation的方式,为什么运行总提示error at ::0 can't find referenced pointcut allMethods 。包都已经导入进去了 allMethods方法明明就在啊,会可能是什么原因不能运行呢?
package com.bjsxt.spring;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;@Aspect
public class SecurityHandler {

@Pointcut("expression(* com.bjsxt.spring)")
private void allMethods(){};

@Before("allMethods()")
private void checkSecurity() {
System.out.println("----------checkSecurity()---------------");
}
}