The default values in the action configuration
1> if no class is specified for action, the default value is Actionsupport
2> If no method is specified for action, the Execute () method in action is executed by default
3> if the Name property of result is not specified, the default value is success
--------------------------------------------------------------------------------------------
General Introduction to constants
Specify the request suffix required for Struts 2 processing
Constants can be configured in Struts.xml or Struts.properties and are recommended for configuration in Struts.xml, both of which are configured as follows:
To configure constants in the Struts.xml file
<struts>
<constant name= "struts.action.extension" value= "Do" >/*** modify the default suffix for Struts2 if you have a comma-delimited number of suffixes
</struts>
It is best to configure the other not recommended in this configuration file
Sets whether the browser caches static content with the default value of True
<constantname= "Struts.serve.static.browserCache" value= "false"/>
Whether the system automatically reloads the file default value False
<constantname= "Struts.configuration.xml.reload" value= "true"/>
When integrated with spring, specifies that spring is responsible for the creation of the Action object
<constantname= "Struts.objectfactory" value= "Spring"/>
Whether dynamic method calls are supported
Size limit for uploaded files
--------------------------------------------------------------------------------------------------------------- --
Process flow of STRUTS2
The user requests a first entry into the Web.
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
The filter filters the user's request first, by default, if the user requests a path with no suffix or suffix one. Action End
This is the request will be transferred to the STRUTS2 framework, otherwise the STRUTS2 framework will skip the request and pass through a series of interceptors when the request is transferred to the STRUTS2 framework.
, and then to the action
Request----->strutsprepareandexecutefilter----->interceptor Interceptor is the core of struts2---------->action---------> Result--------->jsp/html----> Response
What is the difference between action management in Struts1 and Struts2?
Each request creates an action, so the action in STRUTS2 is thread-safe