Brief introduction of Struts2 common interceptor concepts

exception : Map the exception thrown by the Action to the result, and automatically handle the exception through redirection, generally as the final interceptor

chain : Allows the current Action to use the attributes of the last executed Action. This interceptor is usually used with the result type of the chain (<result type="chain"/ ··· ···>)

conversionError : Store the conversion error information in the Action field, including the converted string and parameter types, etc.

debugging : Provide more debugging information for developers in Struts2 development mode

fileUpload : This interceptor is mainly used for file upload, and its main responsibility is to parse the content of the file field in the form

i18n : Interceptor that supports internationalization, its main responsibility is to put the selected language and region into the user's Session domain

modelDriven : When an Action class implements the ModelDriven interface, this interceptor is responsible for storing the result of getModel() in ValueStack

params : Parse the parameters in the Http request and set the parameter value to the attribute value corresponding to the Action

servletConfig : Provides the HttpServletRequest method and HttpServletResponse method that can directly access ServletAPI for Action in the form of a map

validation : complete data validation by executing the validator defined in XxxAction-validation.xml

workflow : Define the default workflow for the Action, generally following other interceptors such as validation, skip the Action and redirect to the INPUT view when the validation fails


Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44965393/article/details/112072239