spring AOP
我有一个类,在com.oms.service包下面,有以下两个方法
bean.xml中AOP配置如下:
<bean id="logInterceptor" class="com.oms.aop.LogInterceptor"></bean>
<!-- 方法1 -->
<aop:config>
<aop:aspect id="logAspect" ref="logInterceptor">
<aop:before method="beforeMethod" pointcut="execution(public * com.oms.service..*update(..))" />
</aop:aspect>
</aop:config>
<!-- 方法2????加不上??? -->
<aop:config>
<aop:aspect id="logAspect" ref="logInterceptor">
<aop:before method="beforeMethod" pointcut="execution(public * com.oms.service..*del(..))" />
</aop:aspect>
</aop:config>
现在的问题是:
方法1 能 weave 切面方法, 但方法2 不能 weave ?
public int update(User user){
return userDao.update(user);
}
public void del(int id){
userDao.del(id);
}
bean.xml中AOP配置如下:
<bean id="logInterceptor" class="com.oms.aop.LogInterceptor"></bean>
<!-- 方法1 -->
<aop:config>
<aop:aspect id="logAspect" ref="logInterceptor">
<aop:before method="beforeMethod" pointcut="execution(public * com.oms.service..*update(..))" />
</aop:aspect>
</aop:config>
<!-- 方法2????加不上??? -->
<aop:config>
<aop:aspect id="logAspect" ref="logInterceptor">
<aop:before method="beforeMethod" pointcut="execution(public * com.oms.service..*del(..))" />
</aop:aspect>
</aop:config>
现在的问题是:
方法1 能 weave 切面方法, 但方法2 不能 weave ?
...全文
相关推荐
Spring AOP完整例子
Spring AOP 几个不同使用方法的完整例子,使用Junit4c测试, 在我的博客上有不同配置组合的说明,可以参考
Spring实现AOP的4种方式
Spring中实现AOP有很多方式,这里总结了四种,有基于代理的实现方式,也有基于AspectJ 的注解方式,还有基于AOP标签的配置
Spring通过注解实现AOP
Spring通过注解实现AOP,Spring通过注解实现AOP,Spring通过注解实现AOPSpring通过注解实现AOP,Spring通过注解实现AOP,Spring通过注解实现AOP
spring aop依赖jar包
springaop依赖的jar包,spring版本2.5.6,如果需要,可以下载使用,欢迎各位评论指出不足
五、Spring源码分析——Spring Aop
NULL 博文链接:https://ylxy3058.iteye.com/blog/2224244


