日期:2014-05-20 浏览次数:20676 次
<bean id="chkLoginAdvice" class="com.zjm.study.advice.chkLoginAdvice" /> <aop:config> <aop:advisor pointcut="execution(* com.zjm.struts.action.LoginAction.login(..))" advice-ref="chkLoginAdvice" /> </aop:config>
package com.zjm.struts.action; public class LoginAction extends DispatchAction { //分发action public ActionForward login(ActionMapping mapping............) { //......... } }
package com.zjm.study.advice; public class chkLoginAdvice implements MethodInterceptor { public Object invoke(MethodInvocation arg0) throws Throwable { System.out.println("测试拦截"); //这句没打印出来,没拦住..... return null; } }