自定义我的拦截器

来源:互联网 发布:java核心编程 pdf下载 编辑:程序博客网 时间:2024/05/17 07:38

1.工程视图

2.MyIntercept类

package com.ask.intercept;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class MyIntercept  extends AbstractInterceptor{
    @Override
    public String intercept(ActionInvocation actioninvocation) throws Exception {
        System.out.println("beging  myInterceptor");
        String result=actioninvocation.invoke();
        System.out.println("end  myInterceptor");
        return result;
    }
   
}
3.struts.xml

0 0
原创粉丝点击