Struts2框架拦截器:

Struts 2框架提供了良好的预配置,并准备使用的盒拦截。下面列出了几个重要的拦截器:

SNInterceptor & 描述
1alias
Allows parameters to have different name aliases across requests.
2checkbox
Assists in managing check boxes by adding a parameter value of false for check boxes that are not checked.
3conversionError
Places error information from converting strings to parameter types into the action's field errors.
4createSession
Automatically creates an HTTP session if one does not already exist.
5debugging
Provides several different debugging screens to the developer.
6execAndWait
Sends the user to an intermediary waiting page while the action executes in the background.
7exception
Maps exceptions that are thrown from an action to a result, allowing automatic exception handling via redirection.
8fileUpload
Facilitates easy file uploading.
9i18n
Keeps track of the selected locale during a user's session.
10logger
Provides simple logging by outputting the name of the action being executed.
11params
Sets the request parameters on the action.
12prepare
This is typically used to do pre-processing work, such as setup database connections.
13profile
Allows simple profiling information to be logged for actions.
14scope
Stores and retrieves the action's state in the session or application scope.
15ServletConfig
Provides the action with access to various servlet-based information.
16timer
Provides simple profiling information in the form of how long the action takes to execute.
17token
Checks the action for a valid token to prevent duplicate formsubmission.
18validation
Provides validation support for actions

完整的细节上面提到的拦截,请loook到Struts2文档。但我会告诉你如何使用拦截器,一般在你的Struts应用程序。

转载于:https://www.cnblogs.com/borter/p/9502144.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值