Constant configuration in struts2_5_struts

Source: Internet
Author: User

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.

 










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.