Constant configuration in struts2_5_struts
Constants can be configured in two ways:
1) Configure in struts. xml: (this configuration method is recommended)
2) Configure constants in struts. properties:
truts.action.extension = action
Since constants can be defined in the following configuration files, we need to understand the search sequence of struts2 loading constants:
Struts-default.xml
Struts-plugin.xml
Struts. xml
Struts. properties
Web. xml
If the same constant is configured in multiple files, the constant value configured in the next file overwrites the constant value configured in the previous file.
Common constants:
1) Specify the sequence set:
2) Specify the suffix of struts2 request processing:
The default value of this attribute is Action, that is, all matches "*. action requests are processed by Struts2. If you need to specify multiple suffixes, separate them with commas (,).
3) automatically reload xml files:
When the struts file is modified, the system automatically reloads the file. The default value is false. It is best to set this value to true during development,
4) print the constant of the error message:
When the secondary constant is used in development mode, more detailed error information is printed.
5) struts supports dynamic attributes:
This attribute sets whether struts supports dynamic attributes. The default value of this attribute is true. When this attribute is disabled, it can be set to false,
6) constants used to manage the size of uploaded files:
Set the size of the uploaded file.