|
拦截器 |
名字 |
说明 |
|
Alias Interceptor |
alias |
在不同请求之间将请求参数在不同名字件转换,请求内容不变
|
|
Chaining Interceptor |
chain |
让前一个 Action 的属性可以被后一个 Action 访问,现在和 chain 类型的 result ( <result type=”chain”> )结合使用。
|
|
Checkbox Interceptor |
checkbox |
添加了 checkbox 自动处理代码,将没有选中的 checkbox 的内容设定为 false ,而 html 默认情况下不提交没有选中的 checkbox 。
|
|
Cookies Interceptor |
cookies |
使用配置的 name,value 来是指 cookies
|
|
Conversion Error Interceptor |
conversionError |
将错误从 ActionContext 中添加到 Action 的属性字段中。
|
|
Create Session Interceptor |
createSession |
自动的创建 HttpSession ,用来为需要使用到 HttpSession 的拦截器服务。
|
|
Debugging Interceptor |
debugging |
提供不同的调试用的页面来展现内部的数据状况。
|
|
Execute and Wait Interceptor |
execAndWait |
在后台执行 Action ,同时将用户带到一个中间的等待页面。
|
|
Exception Interceptor |
exception |
将异常定位到一个画面
|
|
File Upload Interceptor |
fileUpload |
提供文件上传功能
|
|
I18n Interceptor |
i18n |
记录用户选择的 locale
|
|
Logger Interceptor |
logger |
输出 Action 的名字
|
|
Message Store Interceptor |
store |
存储或者访问实现 ValidationAware 接口的 Action 类出现的消息,错误,字段错误等。
|
|
Model Driven Interceptor |
model-driven |
如果一个类实现了 ModelDriven ,将 getModel 得到的结果放在 Value Stack 中。
|
|
Scoped Model Driven |
scoped-model-driven |
如果一个 Action 实现了 ScopedModelDriven ,则这个拦截器会从相应的 Scope 中取出 model 调用 Action 的 setModel 方法将其放入 Action 内部。
|
|
Parameters Interceptor |
params |
将请求中的参数设置到 Action 中去。
|
|
Prepare Interceptor |
prepare |
如果 Acton 实现了 Preparable ,则该拦截器调用 Action 类的 prepare 方法。
|
|
Scope Interceptor |
scope |
将 Action 状态存入 session 和 application 的简单方法。
|
|
Servlet Config Interceptor |
servletConfig |
提供访问 HttpServletRequest 和 HttpServletResponse 的方法,以 Map 的方式访问。
|
|
Static Parameters Interceptor |
staticParams |
从 struts.xml 文件中将 <action> 中的 <param> 中的内容设置到对应的 Action 中。
|
|
Roles Interceptor |
roles |
确定用户是否具有 JAAS 指定的 Role ,否则不予执行。
|
|
Timer Interceptor |
timer |
输出 Action 执行的时间
|
|
Token Interceptor |
token |
通过 Token 来避免双击
|
|
Token Session Interceptor |
tokenSession |
和 Token Interceptor 一样,不过双击的时候把请求的数据存储在 Session 中
|
|
Validation Interceptor |
validation |
使用 action-validation.xml 文件中定义的内容校验提交的数据。
|
|
Workflow Interceptor |
workflow |
调用 Action 的 validate 方法,一旦有错误返回,重新定位到 INPUT 画面
|
|
Parameter Filter Interceptor |
N/A |
从参数列表中删除不必要的参数
|
|
Profiling Interceptor |
profiling |
通过参数激活 profile
|
struts拦截器说明
最新推荐文章于 2020-06-20 15:41:38 发布
本文介绍 Struts 框架中的多种拦截器及其作用,包括参数处理、调试、异常处理等功能,帮助理解 Struts 的工作原理。
184

被折叠的 条评论
为什么被折叠?



