Detailed explanation of constant configuration in struts2

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
 "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
       <!--Specify the default encoding set of Web applications. This property is very useful for processing Chinese request parameters. To obtain Chinese request parameter values, this property value should be set to GBK or GB2312;
           Tip: When setting this parameter to GBK, it is equivalent to calling the setCharacterEncoding method of HttpServletRequest. >
 <constant name="struts.i18n.encoding" value="UTF-8" />

       <!--Specify Struts 2 default ObjectFactory Bean, the default value of this property is spring. >
 <constant name="struts.objectFactory" value="spring" />

       <!--Specify the automatic assembly mode of the Spring framework. The default value of this attribute is name, that is, it is automatically assembled according to the name attribute of the bean by default. >
 <constant name="struts.objectFactory.spring.autoWire" value="name" />

       <!--This property specifies whether to cache the Bean instance when integrating the Spring framework. This property only allows two property values, true and false, and its default value is true. It is generally not recommended to modify the property value. >
 <constant name="struts.objectFactory.spring.useClassCache" value="true" />

       <!--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, corresponding to the file upload framework using cos, pell upload and common -fileupload file upload framework. The default value of this property is jakarta.
           Note: If you need to use the cos or pell file upload method, you should copy the corresponding JAR file to the web application. For example, if you use the cos upload method, you need to download the JAR file of the cos framework and put the file on the WEB -INF/lib path. >
 <constant name="struts.multipart.parser" value="jakarta" />

       <!--This attribute specifies the temporary save path of the uploaded file. The default value of this attribute is javax.servlet.context.tempdir. >
 <constant name="struts.multipart.saveDir" value="" />

       <!--This attribute specifies the maximum number of bytes allowed for the entire request content in a Struts 2 file upload. >
 <constant name="struts.multipart.maxSize" value="1000000000000" />

       <!--This attribute specifies the request suffix that needs 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 the user needs to specify multiple request suffixes, multiple suffixes Separate them with commas (,). >
 <constant name="struts.action.extension" value="do" />

       <!--This property sets whether to provide static content services through JAR files. This property only supports true and false property values. The default property value of this property is true. >
 <constant name="struts.serve.static" value="true" />

       <!--This property sets whether the browser caches static content. When the application is in the development stage, we want to get the latest response from the server for every request, then this property can be set to false. >
 <constant name="struts.serve.static.browserCache" value="true" />

       <!--This attribute sets whether the Struts 2 application uses development mode. If this attribute is set to true, more and more friendly error prompts can be displayed when the application fails. This attribute only accepts two values ​​of true and flase. The default value of the property is false. Usually, when the application is in the development stage, this property is set to true, and when it enters the product release stage, the property is set to false. >
 <constant name="struts.devMode" value="false" />

       <!--This property sets whether the system reloads the resource file every time an HTTP request arrives (allows internationalized file reloading). The default value of this property is false. It is more beneficial to set this property to true during the development phase development, but this property should be set to false during the production release phase.
           Tip: If this property is set to true in the development phase, the internationalized resource file can be reloaded at each request, so that developers can see the real-time development effect; this property should be set to false in the product release phase, in order to To provide responsive performance, the need to reload the resource file for each request will greatly reduce the performance of the application. >
 <constant name="struts.i18n.reload" value="false" />

       <!--This attribute specifies the default view theme of the view tag, and the default value of this attribute is xhtml. >
 <constant name="struts.ui.theme" value="simple" />

       <!--This attribute specifies the suffix of the template file. The default attribute value of this attribute is ftl. This attribute also allows the use of ftl, vm or jsp, corresponding to FreeMarker, Velocity and JSP templates respectively. >
 <constant name="struts.ui.templateSuffix" value="ftl" />

       <!--This property sets whether the system will automatically reload the file when the struts.xml file is changed. The default value of this property is false. >
 <constant name="struts.configuration.xml.reload" value="false" />

       <!--This attribute specifies the internationalized resource files required by the Struts 2 application. If there are multiple internationalized resource files, the file names of the multiple resource files are separated by commas (,). >
 <constant name="struts.custom.i18n.resources" value="nationz" />

       <!--For some Java EE servers, HttpServlet Request does not support calling the getParameterMap() method. In this case, you can set the value of this attribute to true to solve the problem. The default value of this attribute is false. For WebLogic, Orion and OC4J servers , you should usually set this property to true. >
 <constant name="struts.dispatcher.parametersWorkaround" value="false" />

       <!--Specifies whether to cache FreeMarker templates. The default value is false. >
 <constant name="struts.freemarker.templatesCache" value="true" />

       <!--This property only supports two property values, true and false, and the default value is true. Usually there is no need to modify the property value. >
 <constant name="struts.freemarker.wrapper.altMap" value="true" />

       <!--This property specifies whether the XSLT Result uses stylesheet caching. When the application is in development, this property is usually set to true; when the application is in production use, this property is usually set to false. >
 <constant name="struts.xslt.nocache" value="false" />

       <!--This attribute specifies the configuration file loaded by default by the Struts 2 framework. If you need to specify multiple configuration files to be loaded by default, separate the file names of multiple configuration files with an English comma (,). The default value of this attribute See this attribute value for struts-default.xml, struts-plugin.xml, struts.xml, so you should understand why the Struts 2 framework loads the struts.xml file by default. >
 <constant name="struts.configuration.files" value="struts-default.xml,struts-plugin.xml" />

       <!-- Sets whether the mapper always selects the full namespace. The default value of this property is false. >
 <constant name="struts.mapper.alwaysSelectFullNamespace" value="false" />

       <!--Set the root path for the Convention plugin to locate view resources. The default value is /WEB-INF/content>
 <constant name="struts.convention.result.path" value="/WEB-INF/content/" />
 
       <!--Convention plugin uses the constant specified package as the root package>
 <constant name="struts.convention.action.package" value="default" />
 
       <!--Whether to search Action from package>
 <constant name="struts.convention.action.disableScanning" value="false"/>
       
       <!-- The official only stated that it needs to be set under jboss, the situation is unknown-->
 <constant name="struts.convention.exclude.parentClassLoader" value="true" />
 <constant name="struts.convention.action.fileProtocols" value="jar,zip" />

       <!--Include actions in which jar packages. Comma-separated string. >
 <constant name="struts.convention.action.includeJars" value=".*?/_wl_cls_gen.*?jar(!/)?" />

       <!-- Determine the path to search for packages. As long as the package ending with action is searched. >
 <constant name="struts.convention.package.locators" value="action" />
 
</struts>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325601836&siteId=291194637