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 刘铮 阅读(205) 评论(0)  编辑  收藏 所属分类: Spring


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

留言簿(1)

文章分类(141)

文章档案(147)

搜索

最新评论