我想在 Spring (3.2.3) @Controller 中的每个方法之前运行一些代码。我定义了以下内容,但它不会运行。我怀疑切入点表达式不正确。
调度程序-servlet.xml
<aop:aspectj-autoproxy/>
<bean class="com.example.web.controllers.ThingAspect"/>
cewc事物方面
@Pointcut("execution(com.example.web.controllers.ThingController.*(..))")
public void thing() {
}
@Before("thing()")
public void doStuffBeforeThing(JoinPoint joinPoint) {
// do stuff here
}