spring AOP

kangwei_ch kangwei_ch 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我有一个类,在com.oms.service包下面,有以下两个方法

	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 ?
...全文
评论 1
收藏 已收藏
分享
返回顶部
kangwei_ch
Java 51,407 成员 86,127 内容