ITeye博客

Spring DaoMethodAfterAdvice使用例子

javapub · 2011-02-10 19:08 · Spring&EJB · 企业架构 · Java · Spring · AOP · Bean · Markdown

该拦截器会在bean的方法执行后被执行 [code="java"] import java.lang.reflect.Method; import org.springframework.aop.AfterReturningAdvice; public class DaoMethodAfterAdvice implements AfterReturningAdvice { public void afterReturning(Object arg0, Method arg1, Object[] arg2, Object arg3) throws Throwable { System.out.println("[DaoMethodAfterAdvice]:" + arg0 + " : " + arg2[0]); } } [/code] 配置文件 [code="java"] beforeDaoAdvice afterDaoAdvice throwsDaoAdvice aroundAdvice [/code] 完整代码见附件

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。