spring AOP为什么需要配置了没有效果?

### spring Aop的配置一定要配置在springmvc配置文件中
 
 
 
 
springMVC.xml

1
<!-- AOP 注解方式 ;定义Aspect --> 2 <!-- 激活组件扫描功能,在包com.ly.aop.aspect及其子包下面自动扫描通过注解配置的组件--> 3 <context:component-scan base-package="com.relaxPalace.web.aop.aspect"/> 4 <!-- 启动AspectJ支持 只对扫描过的bean有效--> 5 <aop:aspectj-autoproxy proxy-target-class="true" />

注意:spring AOP的配置一定要写在springmvc配置文件中,直接在spring中配置是没有效果的

猜你喜欢

转载自www.cnblogs.com/xuan-cz/p/10055105.html
今日推荐