Monday, April 22, 2013

Struts2 Framework Interceptors


Struts 2 framework provides a good list of out-of-the-box interceptors that come preconfigured and ready to use. Few of the important interceptors are listed below:
SNInterceptor & Description
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

No comments:

Post a Comment