各位,我最近做一个aop拦截的,文件在com.kid.action..*。就是action的下一层当中。我使用了多种方式来拦截也没有办法实现。请熟悉的朋友帮忙解答一下。方案一:
这一种删掉!widthin(org.springframework.web..*)后可以拦到。但拦到的很多的是我余的。
@Pointcut("execution(org.springframework.web.servlet.ModelAndView *.*(..))")
public void doPoint2(){}

@Before("doPoint2()&&!within(org.springframework.web..*)")
public void doGoLog2(ProceedingJoinPoint pjp){
log.warn("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
log.warn("start "+pjp.getTarget().getClass());
}方案二:
@Pointcut("execution(org.springframework.web.servlet.ModelAndView com.kid.action..*.*(..))")
public void doPoint2(){}

@Before("doPoint2()")
public void doGoLog2(ProceedingJoinPoint pjp){
log.warn("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
log.warn("start "+pjp.getTarget().getClass());
}请大家帮我看下。先谢谢了。