The default values in the action configuration

Source: Internet
Author: User


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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.