Spring4 + AOP配置正确可是对Controller无效

2018-01-03  本文已影响0人  Ksewen

刚接触AOP,踩了一些小坑,仅做记录:

@Configuration
@EnableWebMvc
@EnableAspectJAutoProxy
@ComponentScan("com.eyee.esdata.controller")
public class WebConfig extends WebMvcConfigurerAdapter {
}

AOP的注解一定要写在webconfig里,而且一定要写在扫描加载Controller之前!!!

上一篇 下一篇

猜你喜欢

热点阅读