I tried to use PointCut to perform some post action after ModelAndView.setViewName
, but it seems that it never triggers:
@Aspect
@Component
public class TestAspect {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Pointcut("execution(* org.springframework.web.servlet.ModelAndView.*(..))")
public void testPointCut() {
}
@After("testPointCut()")
public void afterPointCut(JoinPoint joinPoint) {
logger.debug("afterPointCut");
}
}
If I change the execution
part to some class of my own, this point cut works.
So what is the correct way to add PointCut
to ModelAndView
?