Solution:
Create a file struts. properties in the src directory.
Content is
Struts. locale = en_GB
Struts. properties File Settings configuration details:
The details are as follows:
Struts. Configuration
This attribute specifies the configuration file manager that loads the struts 2 configuration file. The default value of this attribute is org. Apache. struts2.config. defaultconfiguration, which is the default configuration file manager of struts 2. If you need to implement your own Configuration Manager, developers can implement a class that implements the configuration interface, which can load the struts 2 configuration file by themselves.
==========================================
Struts. locale
Specify the default locale of the Web application.
==========================================
Struts. i18n. Encoding
Specifies the default set of web applications. This attribute is very useful for processing Chinese Request Parameters. For obtaining Chinese request parameter values, set this attribute value to GBK or gb2312.
If this parameter is set to GBK, The setcharacterencoding method of httpservletrequest is called.
Struts. objectfactory
Specify the default objectfactory bean of struts 2. The default value of this attribute is spring.
Struts. objectfactory. Spring. autowrite
Specifies the automatic assembly mode of the Spring framework. The default value of this attribute is name, which means automatic assembly based on the bean name attribute by default.
Struts. objectfactory. Spring. useclasscache
This attribute specifies whether to cache bean instances when integrating the Spring framework. This attribute only allows the use of true and false attribute values. Its default value is true. We do not recommend that you modify this attribute.
Struts. objecttypedeterminer
This attribute specifies the type detection mechanism of struts 2. Generally, the two attribute values tiger and notiger are supported.
Struts. multipart. parser
This attribute specifies the framework for processing multipart/form-data mime-type (File Upload) requests. This attribute supports attribute values such as cos, Pell, and Jakarta, that is, it corresponds to the COs File Upload framework, Pell upload, and common-fileupload File Upload framework. The default value of this attribute is Jakarta.
Note: If you need to upload cos or Pell files, copy the corresponding jar files to the Web application. For example, to use the COs upload method, you need to download the JAR file of the CoS framework and put the file in the WEB-INF/lib path.
Struts. multipart. savedir
This attribute specifies the temporary storage path of the uploaded file. The default value of this attribute is javax. servlet. Context. tempdir.
Struts. multipart. maxsize
This attribute specifies the maximum number of bytes allowed for the entire request content during struts 2 file upload.
Struts. Custom. Properties
This attribute specifies that the struts 2 Application loads the custom property file. The property specified in this custom property file does not overwrite the property specified in the Struts. properties file. If you need to load multiple custom property files, the names of multiple custom property files are separated by commas.
Struts. Mapper. Class
Specify to map the HTTP request to the er of the specified action. Struts 2 provides the default er org. Apache. struts2.dispatcher. Mapper. defaultactionmapper. By default, the er maps the request prefix to the action name attribute.
Struts. Action. Extension
This attribute specifies the request suffix to be processed by struts 2. The default value of this attribute is action, that is, all requests matching *. Action are processed by struts 2. If you need to specify multiple request suffixes, multiple suffixes are separated by commas.
Struts. Serve. Static
This attribute sets whether to provide static content services through the JAR file. This attribute only supports true and false attribute values. The default attribute value of this attribute is true.
Struts. Serve. Static. browsercache
This attribute sets whether the browser caches static content. When an application is in the development stage, you can set this attribute to false if you want to obtain the latest response from the server for each request.
Struts. Enable. dynamicmethodinvocation
This attribute sets whether struts 2 supports dynamic method calls. The default value of this attribute is true. To disable dynamic method calling, set this attribute to false.
Struts. Enable. slashesinactionnames
This attribute sets whether struts 2 allows the use of diagonal lines in the action name. The default value of this attribute is false. If you want to allow a slash in the action name, you can set this attribute to true.
Struts. Tag. altsyntax
This attribute specifies whether expression syntax can be used in struts 2 labels. Because expression syntax is usually used in labels, the attribute should be set to true, and the default value of this attribute is true.
Struts. devmode
This attribute sets whether the struts 2 application uses the development mode. If this attribute is set to true, more and more friendly error messages can be displayed when an application error occurs. This attribute only accepts the true and flase values. The default value of this attribute is false. Generally, an application sets this attribute to true during development. when the product is released, this attribute is set to false.
Struts. i18n. Reload
This attribute sets whether the system reloads the resource file every time an HTTP request arrives. The default value of this attribute is false. Setting this attribute to true during development is more conducive to development, but it should be set to false during product release.
Prompt that the property is set to true in the development phase, and the international resource file can be re-loaded upon each request, so that developers can see the real-time development effect; this attribute should be set to false in the product release phase to provide response performance. re-loading the resource file for each request will greatly reduce the application performance.
Struts. UI. Theme
This attribute specifies the default view topic of the view label. The default value of this attribute is XHTML.
Struts. UI. templatedir
This attribute specifies the location of the template file required for the view topic. The default value of this attribute is template, that is, the template file under the template path is loaded by default.
Struts. UI. templatesuffix
This attribute specifies the suffix of the template file. The default attribute value of this attribute is FTL. This attribute also allows FTL, Vm, or JSP to correspond to freemarker, velocity, and JSP templates respectively.
Struts. configuration. xml. Reload
This attribute sets whether the system automatically reloads the Struts. xml file after it changes. The default value of this attribute is false.
Struts. Velocity. configfile
This attribute specifies the location of the velocity. properties file required by the velocity framework. The default value of this attribute is velocity. properties.
Struts. Velocity. contexts
This attribute specifies the context position of the velocity framework. If the framework has multiple contexts, multiple contexts are separated by commas.
Struts. Velocity. toolboxlocation
This attribute specifies the location of the toolbox of the velocity framework.
Struts. url. http. Port
This attribute specifies the listening port of the Web application. This attribute is usually not large for users. It only provides the default port for Web Applications When struts 2 needs to generate a URL (such as a URL tag.
Struts. url. HTTPS. Port
This attribute is similar to the Struts. url. http. Port attribute. The difference is that this attribute specifies the encrypted service port of the Web application.
Struts. url. includeparams
This attribute specifies whether the request parameters are included when struts 2 generates a URL. This property accepts none, get, and all attributes, which correspond to request parameters that do not contain, contain only get parameters, and contain all request parameters.
Struts. Custom. i18n. Resources
This attribute specifies the international resource files required by the struts 2 application. If multiple international resource files exist, the names of these resource files are separated by commas.
Struts. Dispatcher. parametersworkaround
For some java EE servers, the getparametermap () method cannot be called by httpservlet request. You can set this attribute value to true to solve this problem. The default value of this attribute is false. This attribute should be set to true for WebLogic, Orion, and Solaris servers.
Struts. freemarker. Manager. classname
This attribute specifies the freemarker manager used by struts 2. The default value of this attribute is org. Apache. struts2.views. freemarker. freemarkermanager, which is the built-in freemarker manager of struts 2.
Struts. freemarker. wrapper. altmap
This attribute only supports the true and false attribute values. The default value is true. You do not need to modify the attribute value.
Struts. XSLT. nocache
This attribute specifies whether the XSLT result is cached in the style sheet. This attribute is usually set to true when the application is in the development stage. When the application is in the product use stage, this attribute is usually set to false.
Struts. configuration. Files
This attribute specifies the default configuration file loaded by the struts 2 framework. To specify multiple configuration files to be loaded by default, the names of multiple configuration files are separated by commas. The default value of this attribute is Struts-default. XML, struts-plugin.xml, Struts. XML, see the attribute value, the reader should understand why the struts 2 Framework loads the struts. xml file by default.