Struts2 自定义拦截栈
2016-09-08 19:35
302 查看
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.devMode" value="true"></constant> <package name="my" extends="struts-default"> <interceptors> <interceptor name="demo1Interceptor" class="com.sanmao.interceptors.Demo1Interceptor"></interceptor> <interceptor name="costTimeInterceptor" class="com.sanmao.interceptors.CostTimeInterceptor"></interceptor> <interceptor-stack name="mystack"> <interceptor-ref name="exception"/> <interceptor-ref name="alias"/> <interceptor-ref name="i18n"/> <interceptor-ref name="checkbox"/> <interceptor-ref name="datetime"/> <interceptor-ref name="multiselect"/> <interceptor-ref name="params"/> <interceptor-ref name="servletConfig"/> <interceptor-ref name="prepare"/> <interceptor-ref name="chain"/> <interceptor-ref name="modelDriven"/> <interceptor-ref name="fileUpload"/> <interceptor-ref name="staticParams"/> <interceptor-ref name="actionMappingParams"/> <interceptor-ref name="params"/> <interceptor-ref name="conversionError"/> <interceptor-ref name="validation"> <param name="excludeMethods">input,back,cancel,browse</param> </interceptor-ref> <interceptor-ref name="workflow"> <param name="excludeMethods">input,back,cancel,browse</param> </interceptor-ref> <!--定义自己的--> <interceptor-ref name="costTimeInterceptor"></interceptor-ref> <interceptor-ref name="demo1Interceptor"></interceptor-ref> </interceptor-stack> </interceptors> </package> <package name="p1" extends="my"> <!-- 声明自定义拦截器--> <action name="demo1" class="com.sanmao.action.Demo1Action"> <!-- 使用自定义的拦截器:只要自己明确指定了一个拦截器,默认的都不起作用--> <interceptor-ref name="mystack"></interceptor-ref> <result>/success.jsp</result> </action> </package> </struts>
相关文章推荐
- struts2实现Date类型转换和自定义类型转换器
- struts2中处理自定义异常的方法小结
- struts2 自定义拦截器
- Struts2内建自定义拦截器
- struts2之自定义拦截器及拦截器生命周期分析
- 如何自定义Struts2表单验证后的错误信息显示格式/样式
- Struts2使用14 -- 拦截器4 -- 自定义拦截器
- Struts2数据类型转换之自定义数据类型转换
- struts2自定义拦截器 模拟session超时的处理
- struts2自定义拦截器
- Struts2中自定义拦截器导致Action注入参数丢失
- Struts2第七篇【介绍拦截器、自定义拦截器、执行流程、应用】
- S8.1_Struts2_Interceptor 拦截器的原理 拦截器与过滤器的区别 自定义拦截器 拦截器防止表单重复提交
- struts2 已有拦截器使用以及自定义拦截器使用
- struts2自定义拦截器
- 如何自定义Struts2表单验证后的错误信息显示格式/样式
- Struts2自定义初始化及Properties文件操作
- struts2自定义拦截器
- Struts2之自定义类型转换器
- struts2自定义拦截器