您的位置:首页 > 编程语言 > Java开发

struts2 拦截器1

2013-12-04 22:50 183 查看
action invoke前会调用,invoke后会调用

public class FirstInterceptor extends AbstractInterceptor{

@Override
public String intercept(ActionInvocation actionInvocation) throws Exception {
String result = actionInvocation.invoke();
return result;
}

}


<interceptors>
<interceptor name="firstInter" class="com.wolfgang.interceptor.FirstInterceptor"></interceptor>
</interceptors>


<action name="testOGNL" class="com.wolfgang.action.TestOGNL">
<interceptor-ref name="firstInter"></interceptor-ref>
<result>/OGNL/static.jsp</result>
</action>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: