ITeye博客

Spring MethodBeforeAdvice使用例子

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

MethodBeforeAdvice该拦截器会在调用dean的方法前执行 [code="java"] import java.lang.reflect.Method; import org.springframework.aop.MethodBeforeAdvice; public class DaoMethodBeforeAdvice implements MethodBeforeAdvice{ public void before(Method arg0, Object[] arg1, Object arg2) throws Throwable { System.out.println("[DaoMethodBeforeAdvice]:" + arg0 + " : " + arg1[0]); } } [/code] 配置文件信息 [code="java"] beforeDaoAdvice afterDaoAdvice throwsDaoAdvice aroundAdvice [/code] 完整代码请参考附件

评论(0)

暂无评论。

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