Spring学习心得(二)

 

Spring学习心得(二)

1.         advice有四种:Before advice After advice Around advice ,Throws advice

2.         这四种advice分别需要继承的接口为

Advice type

Interface

Throws advice

org.aopalliance.intercept.MethodInterceptor

Before advice

org.springframework.aop.BeforeAdvice

After advice

org.springframework.aop.AfterReturningAdvice

Throws advice

org.springframework.aop.ThrowsAdvice

3Around adviceBefore advice的区别是Before advice是只要没有异常,目标方法一定会被调用,然而Around advice,只有当调用MethodInvocation.proceed()后目标方法才能被调用。而且Around advice还可以返回想返回的值:如Object obj=invocation.proceed();

posted on 2007-09-04 15:59 刘铮 阅读(224) 评论(0)  编辑  收藏 所属分类: Spring

<2025年7月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

导航

统计

留言簿(1)

文章分类(141)

文章档案(147)

搜索

最新评论