In struts2 development, some functions need to be configured in struts. xml
1. General package
/Primer/success. jsp
/Primer/formSuccess. jsp
2. How to Set forwarding and redirection for a package
HelloWorldAction
/Primer
3. Use wildcards in struts. xml configuration
/Pattern/successGlobal. jsp
/Pattern/BookAction. jsp
/Pattern/BookAction. jsp
/Pattern/success. jsp
4. File Upload Configuration
1229339
Application/pdf, application/vnd. ms-excel, application/vnd. ms-powerpoint
.Htm, .ppt
/Upload/success. jsp
/Upload/error. jsp
/Upload/success. jsp
/Upload/error. jsp
5. Custom interceptor Configuration
/Aop/success. jsp
/Aop/error. jsp
6. Form Verification configuration (1) xml configuration for manual verification (you only need to specify the input to jump to the page)
/Validate/success. jsp
/Validate/login. jsp
/Validate/success. jsp
/Validate/loginxml. jsp
(2) xml validation (for all methods in ValidateAction) (note the xml file naming rules: ValidateXmlAction-validation.xml)
True
The user name cannot be blank.
True
^ [A-Za-z0-9] {6, 12} $
(3) xml validation (for the specified method in ValidateAction) (note the xml file naming rules: ValidateXmlAction-validateXmlAction_login-validation.xml)
True
The user name cannot be blank.
True
^ [A-Za-z0-9] {6, 12} $
(4) custom validation (create validators. xml in the src directory and configure it as follows)
7. International Configuration
8. Configure token to prevent repeated submission of forms
Save
/Model/add. jsp
/Model/success. jsp
/Model/edit. jsp
/Model/message. jsp