1.<constant name= "struts.i18n.encoding" value= "UTF-8"/>
Specifies the default encoding set for Web applications, which is equivalent to calling the HttpServletRequest setcharacterencoding method.
2.<constant name= "Struts.i18n.reload" value= "false"/>
This property sets whether the system reloads the resource file every time the HTTP request arrives. The default value for this property is false. Setting this property to true during the development phase is more beneficial to development, but it should be set to false during the product release phase.
3.<constant name= "struts.custom.i18n.resources" value= "Application"/>
This property specifies the Internationalized resource files required by the Struts 2 application and, if there are multiple internationalized resource files, the file names of multiple resource files are separated by commas (,).
4.<constant name= "Struts.action.extension" value= "action"/>
This property specifies the request suffix required for Struts 2 processing, and the default value of the property is action, where all matching *.action requests are handled by Struts 2. If a user needs to specify more than one request suffix, multiple suffixes are separated by commas (,).
5.<constant name= "Struts.serve.static.browserCache" value= "true"/>
Sets whether the browser caches static content, the default value is True (used in production environments), and the development phase is best closed.
6.<constant name= "Struts.configuration.xml.reload" value= "false"/>
When the configuration file for Struts 2 is modified, the system automatically reloads the file, the default value is False (used in production environments), and the development phase is best opened.
7.<constant name= "Struts.configuration.files" value= "Struts-default.xml,struts-plugin.xml,struts.xml"/>
This property specifies the configuration file that is loaded by default for the Struts 2 framework, and the file names of multiple profiles are separated by commas (,) if you need to specify that more than one configuration file be loaded by default. The default value for this property is Struts-default.xml,struts-plugin.xml, Struts.xml, to see the property value, the reader should understand why the Struts 2 framework loads the Struts.xml file by default.
8.<constant name= "struts.configuration" value= "Org.apache.struts2.config.DefaultConfiguration"/>
Specifies that the STRUTS2 configuration file Manager is loaded Default to Org.apache.struts2.config.DefaultConfiguration, developers can customize the Profile Manager, the class to implement the configuration interface, you can automatically load struts2 configuration file.
8.<constant name= "Struts.continuations.package" value= ""/>
Contains the full sequential package name of the actions.
10.<constant name= "Struts.devmode" value= "true"/>
In development mode, so that you can print more detailed error messages.
11.<constant name= "Struts.serve.static.browserCache" value= "false"/>
This property sets whether the browser caches static content. You can set this property to False when the application is in the development phase, and we want each request to receive the latest response from the server.
12.<constant name= "Struts.enable.DynamicMethodInvocation" value= "false"/>
This property sets whether struts 2 supports dynamic method calls, and the default value of this property is true. If you need to turn off dynamic method calls, you can set this property to False.
13.<constant name= "Struts.enable.SlashesInActionNames" value= "false"/>
This property sets whether Struts 2 allows you to use a slash in the action name, and the default value for this property is false. You can set this property to True if the developer wants to allow a slash in the action name.
14.<constant name= "Struts.tag.altSyntax" value= "true"/>
This property specifies whether the expression syntax is allowed in the Struts 2 tag, because it is usually necessary to use expression syntax in the label, so the property should be set to TRUE and the default value of the property is true.
15.<constant name= "Struts.devmode" value= "false"/>
This property sets whether the Struts 2 application uses development mode. If you set this property to True, you can display more and friendlier error prompts when an error is applied. This property accepts only true and flase two values, and the default value for this property is false. Typically, the application is set to true at development time, and this property is set to False when the product release phase is entered.
16.<constant name= "Struts.ui.theme" value= "xhtml"/>
This property specifies the default view theme for the view label, which defaults to XHTML and can be simple,xhtml or Ajax.
17.<constant name= "Struts.ui.templateDir" value= "template"/>
This property specifies the location of the template file that is required for the view theme, and the default value of the property is template, which is to load the template file under the template path by default.
18.<constant name= "Struts.ui.templateSuffix" value= "FTL"/>
This property specifies the suffix of the template file, which has a default property value of FTL. This property also allows you to use FTL, VMS, or JSPs, respectively, for freemarker, Velocity, and JSP templates.
19.<constant name= "Struts.velocity.configfile" value= "Velocity.properties"/>
This property specifies the location of the Velocity.properties file required by the velocity framework. The default value for this property is velocity.properties.
20.<constant name= "struts.velocity.contexts" value= ""/>
This property specifies the context position of the velocity frame and, if the frame has multiple frames, separated by an English comma (,).
21.<constant name= "struts.velocity.toolboxlocation" value= ""/>
This property specifies the position of the velocity frame's toolbox.
22.<constant name= "Struts.url.http.port" value= "/>"
This property specifies the listening port on which the Web application resides. This property is usually not very useful, except that it provides the default port for a Web application when Struts 2 needs to generate a URL, such as a URL tag.
23.<constant name= "Struts.url.https.port" value= "443"/>
This property is similar to the function of the Struts.url.http.port property, which specifies that the cryptographic service port for the Web application is specified by this property.
24.<constant name= "Struts.url.includeParams" value= "None|get|all"/>
This property specifies whether the request parameter is included when Struts 2 generates a URL. This property accepts none, get, and all three property values, respectively, for not including, containing only get type request parameters, and containing all request parameters.
25.<constant name= "Struts.dispatcher.parametersWorkaround" value= "false"/>
For some Java EE servers, the HttpServlet request call Getparametermap () method is not supported, and you can set this property value to true to resolve the problem. The default value for this property is false. This property should normally be set to true for WebLogic, Orion, and OC4J servers.
26.<constant name= "Struts.freemarker.manager.classname" value= ""/>
This property specifies the Freemarker manager used by struts 2. The default value for this property is Org.apache.struts2.views.freemarker.FreemarkerManager, which is a Freemarker manager built in Struts 2.
27.<constant name= "Struts.freemarker.wrapper.altMap" value= "true"/>
This property supports only true and false two property values, and the default value is true. Typically, you do not need to modify this property value.
28.<cosntant name= "Struts.freemarker.templatesCache" value= "false"/>
Sets whether to cache Freemarker templates, which is equivalent to copying template to Web_app/templates.
29.<constant name= "Struts.xslt.nocache" value= "false"/>
This property specifies whether the XSLT result uses the style sheet cache. This property is usually set to True when the application is in the development phase, and is usually set to False when the application is in the product usage phase.
30.<constant name= "struts.custom.properties" value= "Application,org/apache/struts2/extension/custom
"/>
Specifies that the STRUTS2 application loads a user-defined property file that specifies a property that does not overwrite the properties specified in the Struts.properties file. If you need to load multiple custom property files, the file names of multiple custom properties files are separated by commas (,). (i.e. do not overwrite struts.properties!)
31.<constant name= "Struts.locale" value= "Zh_cn"/>
The default internationalization locale information.
32.<constant name= "Struts.mapper.class" value= "Org.apache.struts2.dispatcher.mapper.DefaultActionMapper"/>
Specifies the request URL and action Mapper, which defaults to Org.apache.struts2.dispatcher.mapper.DefaultActionMapper
33.<cosntant name= "Struts.mapper.alwaysSelectFullNamespace" value= "false"/>
Set whether the namespace has been selected anywhere before the last slash
34.<constant name= "struts.multipart.maxSize" value= "2097152"/>
Multipart the maximum size of the request information (used for file uploads, which specifies the maximum number of bytes allowed for the entire request content on the Struts 2 file).
35.<constant name= "struts.multipart.parser" value= "cos"/>
This property specifies processing Mime-type multipart/form-data, file uploads (COS, Pell, Jakarta)
A Org.apache.struts2.dispatcher.multipart.MultiPartRequest parser interface (for file uploads) that is used specifically for multipart request information.
36.<constant name= "Struts.multipart.saveDir" value= "/tmpuploadfiles"/>
Specifies the temporary directory when uploading files, using Javax.servlet.context.tempdir by default.
37.<constant name= "struts.objectfactory" value= "Spring"/>
This property specifies that the action in Struts 2 is created by the spring container.
38.<constant name= "Struts.objectFactory.spring.autoWire" value= "name"/>
Specifies the assembly mode of the spring framework, which is assembled by: name, type, auto, and constructor (name is the default assembly mode)
39.<constant name= "Struts.objectFactory.spring.useClassCache" value= "true"/>
This property specifies whether the bean is cached when the spring is consolidated, and the value is true or FALSE, and the default is true.
40.<cosntant name= "Struts.objecttypedeterminer" value= "Tiger"/>
Specify type checking, including Tiger and Notiger
Detailed constant configuration in struts2
This article mainly explains the struts2 in the constant constant configuration, the content mainly comes from the Internet collation.
<?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> <!--Specifies the default encoding set for Web applications. This property is useful for handling Chinese request parameters, and you should set this property value to GBK or GB2312 when you get the Chinese request parameter value: When this parameter is set to GBK, it is equivalent to calling the HttpServletRequest Setcharacterencoding method > <constant name= "struts.i18n.encoding" value= " UTF-8 "/> <!--specifies Struts2 default objectfactory Bean, which defaults to spring.> <constant name=" Struts.objectfactory "value = "Spring"/> <!--specifies the automatic assembly mode for the spring framework, which defaults to name, which is automatically assembled according to the Bean's Name property. > <constant name= "struts.objectFactory.spring.autoWire" value= "name"/> <!--This property specifies whether the bean instance is cached when the spring framework is consolidated , this property allows only true and false two property values, and its default value is true. Modifying this property value is not usually recommended .> <constant name= " Struts.objectFactory.spring.useClassCache "value= true"/> <!--This property specifies the framework for handling the Multipart/form-data MIME type (file upload) request
, this property supports Cos,pell and Jakarta attribute values, that is, corresponding to the use of the Cos file upload frame, 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, using the Cos upload method, you need to download the COS framework jar file yourself and place the file under the Web-inf/lib path. > <constant name= "struts.multipart.parser" value= "Jakarta"/> <!--This property specifies the temporary save path for the uploaded file. The default value for this property is Javax.servlet.context.tempdir. > <constant name= "struts.multipart.saveDir" value= ""/> <!-- This property specifies the maximum number of bytes allowed for the entire request content on the Struts 2 file. > <constant name= "struts.multipart.maxSize" value= "1000000000000"/> <!--This property specifies the request suffix required for Struts 2 processing.
The default value for this property is action, where all matching *.action requests are handled by Struts 2. If a user needs to specify more than one request suffix, multiple suffixes are separated by commas (,). > <constant name= "struts.action.extension" value= "Do"/> <!--This property setting provides a static content service through a jar file that supports only true and false property values , the default property value for 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 development, we want each request to get the latest response from the server, and you can set this property to False. > <constant name= " Struts.serve.static.browserCache "value= true"/> <!--this property to set the Struts 2 application to use development mode. If you set this property to True, you can display more when an error is applied,
More friendly error tips. This property accepts only true and flase two values, and the default value for this property is false. Typically, the application is in the development ordersection, set this property to True, and set the property to False when the product publishing phase is entered. > <constant name= "Struts.devmode" value= "false"/> <!--This property setting whether the system reloads the resource file (allowing internationalized file overloading) every time the HTTP request arrives.
The default value for this property is false.
Setting this property to true during the development phase is more beneficial to development, but it should be set to false during the product release phase.
Tip: This property is set to true during the development phase, and the internationalized resource file can be reloaded on each request, allowing developers to see the real time development effect; The release phase of the product should set this property to False to provide response performance, which can significantly degrade the performance of the application by reloading the resource file on each request. > <constant name= "Struts.i18n.reload" value= "false"/> <!--This property specifies the default view theme for the view label, and the default value for this property is XHTML. > <constant name= "struts.ui.theme" value= "simple"/> <!--This property specifies the suffix of the template file, which has the default property value of FTL. This property also allows you to use FTL, VMS, or JSPs. correspond to Freemarker, velocity, and JSP templates respectively. > <constant name= "struts.ui.templateSuffix" value= "FTL"/> <!-- This property sets whether the system automatically reloads the file when the Struts.xml file changes. The default value for this property is False. > <constant name= "struts.configuration.xml.reload" value= False/> <!--This property specifies the Internationalized resource files required by the Struts 2 application and, if there are multiple internationalized resource files, the file names of multiple resource files are separated by commas (,). > <constant name= "struts.custom.i18n.resources" value= "Nationz"/> <!--for some Java EE servers, HttpServlet is not supported Request calls the Getparametermap () sidemethod, you can now set the property value to True to resolve the problem.
The default value for this property is false. This property should normally be set to true for WebLogic, Orion, and OC4J servers. > <constant name= "Struts.dispatcher.parametersWorkaround" value= "false"/> <!-- Specifies whether to cache freemarker templates. Default value false.> <constant name= "Struts.freemarker.templatesCache" value= "true"/> <!-- This property supports only true and false two property values, and the default value is true. You typically do not need to modify this property value. > <constant name= "Struts.freemarker.wrapper.altMap" value= "true"/> <!--This property specifies the XSLT Whether result uses the stylesheet cache. This property is usually set to True when the application is in the development phase, and is usually set to False when the application is in the product usage phase. > <constant name= "Struts.xslt.nocache" value= "false"/> <!--This property specifies the configuration file that is loaded by default for the Struts 2 framework, and if you need to specify a default load of multiple profiles,
The file names of multiple profiles are separated by commas (,) in English. The default value for this property is Struts-default.xml,truts-plugin.xml,struts.xml and you see the property value, 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 for this property is false.> <constant name= "Struts.mapper.alwaysSelectFullNamespace" value= "false"/ > <!--set up Convention Plug-in locator view resource's root path. The default value is/web-inf/content> <constant name= "Struts.convention.result.path" value= "/web-inf/content/"/> <!--The Convention plug-in specifies the package as the root package > <constant name= "struts.convention.action.package" value= "Default"/> <! --whether to search action> <constant name= "struts.convention.action.disableScanning" value= "false"/> <!--from the package The official only explained under JBoss need to set up, the situation unknown--> <constant name= "Struts.convention.exclude.parentClassLoader" value= "true"/> <
Constant Name= "Struts.convention.action.fileProtocols" value= "Jar,zip"/> <!--include the action in which jar packages. Comma split string .> <constant name= "Struts.convention.action.includeJars" value=. *?/_wl_cls_gen.*?jar (!/)?/> <!-- Determine the path to the search package. All packages that end up with action are searched for .> <constant name= "struts.convention.package.locators" value= "action"/> </ Struts>
STRUTS2-Common Constant summary
See note
<?xml version= "1.0" encoding= "UTF-8"?> <! DOCTYPE struts Public "-//apache Software foundation//dtd struts Configuration 2.3//en" "Http://struts.apache.org/dtds /struts-2.3.dtd "> <struts> <!--set it to development mode, set to False when publishing--> <constant name=" Struts.devmode "value=" True '/> <!--setting is hot-loaded when class is modified, set to False--> <constant name= ' struts.convention.classes.reload ' value= ' True '/> <!--the invocation of an automatic dynamic method that can be invoked after this setting: Action!method--> <constant name= " Struts.enable.DynamicMethodInvocation "value=" true "/> <!--Specify the directory address where the JSP file resides--> <constant name=" Struts.con Vention.result.path "value="/web-inf/content//> <!--uses the Struts-default default converter, if rest is used: Rest-default,
Rest need rest jar Plug-ins--> <constant name= "struts.convention.default.parent.package" value= "Struts-default"/> The <!--is used to configure the package name suffix. Defaults to action, actions, struts--> <constant name= "struts.convention.package.locators" value= "Actions"/> <!-- Used to configure the class name suffix, defaultFor action, after setting, STRUTS2 will only look for the suffix name class to do mapping--> <constant name= "Struts.convention.action.suffix" value= "action"/> <!--setting creates an action map even if there are no @action annotations. The default value is False. Because Convention-plugin is a style that is better than configuration, it can be accessed without annotations based on a predefined definition of the method--> <constant name= " Struts.convention.action.mapAllMatches "value=" true "/> <!--custom JSP file-named separator--> <constant name=" Struts.convention.action.name.separator "value="-"/> <!--internationalized resource file name--> <constant name=" struts.custom.i1 8n.resources "value=" i18n/> <!--automatically load internationalized resource files--> <constant name= "Struts.i18n.reload" value= "true"/>
; <!--browser whether to cache static content--> <constant name= "Struts.serve.static.browserCache" value= "false"/> <!--upload file size limit set Place--> <constant name= "struts.multipart.maxSize" value= "-1"/> <!--theme, setting the value to simple, that is, not using the UI template. This will not generate additional HTML tags--> <constant name= "Struts.ui.theme" value= "simple"/> <!--encoding format--> <constant nam E= "struts.i18n.encoding" value= "UTF-8 "/> </struts>
Basic constants
Struts.devmode Optional value True,false (default false), in development mode, STRUTS2 dynamic reload configuration and resource file functionality will take effect by default. More complete log support is also provided in development mode.
Struts.i18n.reload Optional Value True,false (the default value depends on Struts.devmode) and whether the local resource file is automatically reloaded.
The struts.i18n.encoding is primarily used to set the request encoding (default value (UTF-8)), the resolution encoding of the head and include tags. The parsing encoding of the resource and configuration file.
Struts.configuration.xml.reload Optional Value True,false (the default value depends on Struts.devmode) whether the XML configuration file is automatically reloaded
Struts.action.extension sets the suffix of the action request for struts, separated by commas when supporting multiple.
Struts.action.excludePattern set the URL that struts excludes (matching by regular expressions) (multiple, comma-delimited)
Struts.tag.altSyntax Optional Value True,false (default true) supports OGNL expressions
Struts.url.http.port sets the HTTP port that generates the URL
Struts.url.https.port sets the HTTPS port corresponding to the generated URL
Struts.url.includeParams Optional Value None, get, all (default get), set whether the URL contains parameters, and whether to include only the parameters of Get methods.
Struts.locale sets the struts2 default locale and determines which resource file to use.
Struts.ui.templateDir This property specifies the location of the template file that is required for the view theme, and the default value of the property is template, which is to load the template file under the template path by default
Struts.ui.theme This property specifies the default view theme for the view label, which defaults to XHTML.
Struts.ui.templateSuffix This property specifies the suffix of the template file, which has the default property value of FTL. This property also allows the use of FTL, VMS, or JSPs, respectively, for freemarker, Velocity, and JSP templates
Struts.multipart.saveDir sets the default directory for uploading temporary files
Struts.multipart.maxSize sets the maximum limit for temporary files uploaded
Struts.objectFactory.spring.autoWire optional values (name, type, auto, constructor,name) (default name), set spring automatic assembly mode, Only when the spring plug-in is introduced does it work.
Struts.objectFactory.spring.autoWire.alwaysRespect (default false) sets whether objects are always created with automatic assembly policy.
Struts.objectFactory.spring.useClassCache (default false) object factory uses class caching, and development mode is invalid.
Struts.xslt.nocache (default to False) sets whether Xsltresult is not cached.
Struts.custom.properties sets the list of user's custom attribute file names (used, separated)
Struts.custom.i18n.resources set user-defined resource file path list (used, separated)
Struts.serve.static (default false) sets whether to support static resource requests (requiring URLs under struts or static)
Struts.serve.static.browserCache (default false) sets the cache in a static resource response. Valid only when static resources are supported.
Struts.el.throwExceptionOnFailure (Default false) throws RuntimeException if an El expression is parsed or a property cannot be found
Struts.ognl.logMissingProperties (default false) whether the log has no properties found
Struts.ognl.enableExpressionCache whether to cache ognl-parsed expressions.
Struts.enable.DynamicMethodInvocation (default false) supports dynamic method calls, specifying methods on URLs by!method.
Struts.enable.SlashesInActionNames whether a slash is supported in the action segment in the URL
Struts.mapper.alwaysSelectFullNamespace (default false) always uses the URL segment before the last slash as a namespace
Core Object Constants
Struts.actionproxyfactory sets up the Actionproxy entity factory and the factory also generates the default Actioninvoctation
Struts.xworkconverter sets the Xworkconverter object, which is used to get various types of converters.
Struts.unknownhandlermanager sets the implementation class for Unknownhandlermanager to handle exceptions such as methods that cannot be found.
Struts.multipart.handler Set Mutipartrequest Handler (default is Jakarta) corresponding class, Org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest
Struts.mapper.class Optional Value (STRUTS,COMPOSITE,RESTFUL,RESTFUL2) sets the URL resolution and maps to the implementation of the action, (default struts).
Struts.mapper.prefixMapping is mapped to the corresponding mapper through the URL prefix, in the form of urlprefix1:mappername2,urlprefix2:mappername2. You must add Mapperclass as Org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper and specify Struts.mapper.class as the mapper.
The Struts.mapper.composite setting supports a composite (multiple) actionmapper,mappername separated by commas. Struts.mapper.class must be configured for composite to take effect
Struts.mapper.idParameterName is used to restful2actionmapper the parametername corresponding to the ID in the URL
Struts.ognl.allowStaticMethodAccess (default false) sets whether the OGNL expression supports static methods.
Struts.configuration sets the settings class for struts2. (no longer used after 2.1.2)
Struts.urlrenderer sets struts2 URL render (for generated URLs), (default struts), class name Org.apache.struts2.components.ServletUrlRenderer
Struts.objectfactory set Struts2 object factory, Default (struts), Class name Org.apache.struts2.impl.StrutsObjectFactory, which is modified to org.apache.struts2.spring.StrutsSpringObjectFact when the Struts2-spring plug-in is introduced Ory
Struts.xworktextprovider sets the implementation of the STRUTS2 resource file content provider class. Default is Com.opensymphony.xwork2.TextProviderSupport
Struts.actionvalidatormanager sets the implementation class for the Actionvalidatormanager.
Struts.valuestackfactory sets the implementation of the Struts2 Valuestack factory.
Struts.reflectionprovider set the implementation class for Reflectionprovider
Struts.reflectioncontextfactory set the implementation class for Reflectioncontextfactory
Struts.patternmatcher set the implementation class for Patternmatcher
Struts.staticcontentloader set the implementation class for Staticcontentloader