Xiang Jie struts2 in struts.properties

2010-03-29  来源:本站原创  分类:Java  人气:472 

Struts 2 framework has two key configuration files:

struts.xml and struts.properties

One struts.xml document management applications is mainly responsible for the Action mapping, as well as the definition of Action contained in the Result. In addition, Struts 2 framework also includes a struts.properties file, which defines the Struts 2 framework of a large number of properties, developers can change these properties to meet the application requirements.

struts.properties file is a standard Properties file, which contains a series of key-value objects, each key is a Struts 2 property, the key corresponding value is a Struts 2 property value.

struts.properties file is usually placed on Web application WEB-INF/classes path. In fact, as long as the file on the Web application CLASSPATH path, Struts 2 framework can load the file.

In fact, struts.properties contents of the file available on the struts.xml in order to <constant name="" value=""> </ constant> load.

The following configuration parameters of the file to list in detail to facilitate you see;

struts.configuration

This attribute specifies the Struts 2 configuration file loads the configuration file manager. The default value of the property org.apache.Struts2.config.DefaultConfiguration, which is Struts 2 default configuration file manager. If you need to achieve your own configuration manager, developers can achieve an implementation of Configuration interface class that can load their own Struts 2 configuration file.

struts.locale

The specified Web application's default Locale.

struts.i18n.encoding

Specify the default encoding set of Web applications. The attribute request parameters for dealing with the Chinese is very useful, for access to the Chinese request parameter values, it should be the property value is set to GBK or GB2312.

When prompted to set the parameters for GBK, the equivalent of calling the setCharacterEncoding method of HttpServletRequest.

struts.objectFactory

Specified Struts 2 default ObjectFactory Bean, the property default value is spring.

struts.objectFactory.spring.autoWrite

Spring framework specified automatic assembly mode, the default value of the property name, which is the default property name according to Bean's automated assembly.

struts.objectFactory.spring.useClassCache

This attribute specifies the Spring framework for integration, whether the cache Bean instance of the attribute only allows the use of true and false values of two properties, and its default value is true. Generally not recommended to modify the property value.

struts.objectTypeDeterminer

This attribute specifies the type of detection mechanism Struts 2, generally support the tiger and notiger two property values.

struts.multipart.parser: the property designated to deal with multipart / form-data of the MIME type (file upload) request the framework to support the property cos, pell, and jakarta such as property values, that correspond to the use of cos the file upload framework, pell upload and common-fileupload file upload framework. The default value for the property jakarta.

Note If you need to use cos or pell file upload method, it will be the corresponding JAR files to the Web application. For example, the use of cos uploads, you need to download cos framework JAR file and the file on the WEB-INF/lib path.

struts.multipart.saveDir

This attribute specifies the path to save the temporary upload files, the attribute's default value is javax.servlet.context.tempdir.

struts.multipart.maxSize

This attribute specifies the Struts 2 File upload the contents of the entire request to allow the maximum number of bytes.

struts.custom.properties

This attribute specifies the Struts 2 application loading user-defined property file, the custom properties file specified attribute does not override the attributes specified in struts.properties file. If you need to load multiple custom properties file, a number of custom properties file name to English comma (,) separated.

struts.mapper.class

Specifies the HTTP request is mapped to the specified Action mapping device, Struts 2 provides a default Mapper: org.apache.struts2.dispatcher.mapper.DefaultActionMapper. The default mapper prefix, upon request, with the completion of Action of the name attribute mapping.

struts.action.extension

This attribute specifies the need to deal with requests for Struts 2 suffix, the default value of this attribute is action, that all match the *. action requests handled by the Struts 2. If the user needs to specify more than one request for the suffix, then the number of suffixes in English between the comma (,) separated.

struts.serve.static

The property is passed the contents of JAR file provides static services, the property only supports true and false property value, the attribute's default property value is true.

struts.serve.static.browserCache

The property is set if the browser is caching static content. When an application is in development stage, we hope that requests access to the server each time the latest response, you can set this property to false.

struts.enable.DynamicMethodInvocation

The property is set to Struts 2 whether to support the dynamic method calls, the property's default value is true. If you need to close the dynamic method calls, you can set this property to false.

struts.enable.SlashesInActionNames

The property is set to Struts 2 whether to allow the use of a slash in the Action name of the attribute's default value is false. If developers want to allow the use of a slash in the Action name, you can set this property to true.

struts.tag.altSyntax

This property specifies whether to allow the use of the Struts 2 tag expression syntax, which is usually the label will need to use the expression syntax, so property should be set to true, the property's default value is true.

struts.devMode

The property is set whether to use Struts 2 application development model. If you set this attribute to true, you can be displayed when an error in the application of more and more friendly error message. This property only accepts true and flase two values, the property's default value is false. Typically, used in the development stage, this property is set to true, as enter the product release phase, then the property is set to false.

struts.i18n.reload

The properties are set for each HTTP request arrives, the system had to re-load the resource file. The attribute default value is false. In the development phase of this property is set to true will be more conducive to development, but in the product release stage should set the property to false.

Prompted the development phase of this attribute is set true, will be able to reload each time when they request an international resource file, which allows developers to see real-time development results; product release phase should be the attribute set to false, in order to to provide response performance, each request will need to re-load the resource file will greatly reduce the application performance.

struts.ui.theme

This attribute specifies the default view of the view label theme, the property's default value is xhtml.

struts.ui.templateDir

This attribute specifies the theme of the need to view the template file, the default value of the property template, which is the default template load path of the template file.

struts.ui.templateSuffix

This attribute specifies the template file suffix, the attribute's default property value is ftl. This property also allows the use of ftl, vm or jsp, corresponding to FreeMarker, Velocity and JSP templates.

struts.configuration.xml.reload

The property is set when the struts.xml file changes, the system is automatically re-load the file. The default value of the property is false.

struts.velocity.configfile

This attribute specifies the required Velocity framework velocity.properties file. The default value for the property velocity.properties.

struts.velocity.contexts

This attribute specifies the location of Velocity framework of Context, if the frame has more than one Context, then the number of Context in English between the comma (,) separated.

struts.velocity.toolboxlocation

This attribute specifies the location of Velocity frame toolbox.

struts.url.http.port

This attribute specifies the Web application where the listening port. This property is usually not much of users, only when the Struts 2 needs to be generated URL (for example, Url label), the property would only provide Web applications, the default port.

struts.url.https.port

This property is similar to the role of struts.url.http.port property, the difference is the attribute specifies the cryptographic service port Web applications.

struts.url.includeParams

This attribute specifies whether the URL is generated Struts 2 contains the request parameters. The property received none, get, and all three attribute values, corresponding to does not contain only type that contains GET request parameters and contains all the request parameters.

struts.custom.i18n.resources

This attribute specifies the Struts 2 applications require the internationalization of resource file, if multiple copies of an international resource file, then the number of resource file name to English comma (,) separated.

struts.dispatcher.parametersWorkaround

For some Java EE server, does not support the HttpServlet Request call getParameterMap () method, a time to set the property value to true to resolve the problem. The default value of the property is false. For WebLogic, Orion, and OC4J server, usually the property should be set to true.

struts.freemarker.manager.classname

This attribute specifies Struts 2 to use FreeMarker Manager. The default value of the property org.apache.struts2.views.freemarker.FreemarkerManager, this is Struts 2 built-in FreeMarker Manager.

struts.freemarker.wrapper.altMap

This property only supports true and false values of two properties, the default value is true. Is usually no need to modify the property value.

struts.xslt.nocache

This property specifies whether to use the style sheet XSLT Result cache. When an application is in development stage, the property is usually set to true; when applied at the product stage, the property is usually set to false.

struts.configuration.files

This attribute specifies the framework of Struts 2 configuration file loaded by default, if you need to specify the default load multiple profiles, multiple configuration file's name in English between the comma (,) separated. The default value for the property struts-default.xml, struts-plugin.xml, struts.xml, see the property value, the reader should understand why the Struts 2 framework of the default load struts.xml file.

相关文章
  • Xiang Jie struts2 in struts.properties 2010-03-29

    Struts 2 framework has two key configuration files: struts.xml and struts.properties One struts.xml document management applications is mainly responsible for the Action mapping, as well as the definition of Action contained in the Result. In additio

  • struts2 of struts.properties profile Xiangjie 2010-04-16

    struts.action.extension The URL extension to use to determine if the request is meant for a Struts action Extension with the URL to determine if the request is to be used as a Struts action, that is, in fact set the action of the suffix, such as logi

  • struts2 in struts.properties property Xiangjie 2010-06-16

    [Size = medium] Struts 2 framework has two key configuration files: struts.xml and struts.properties Which is responsible for managing struts.xml file in the Action mapping applications, and contains the Result of the Action definition. In addition,

  • SSH2 Configuration Shan Xiang Jie (Struts2 Hibernate3 Spring) 2010-02-23

    web.xml configuration <? xml version = "1.0" encoding = "UTF-8"?> <web-app version = "2.5" xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:

  • Struts2 related to struts-default.xml, struts.xml, struts.properties file Xiangjie 2009-03-21

    Each study a framework, we will inevitably have to learn some information about the configuration file, struts2 is no exception, here I will talk about several major struts2 configuration file. 1) struts-default.xml This file is the struts2 framework

  • Struts2 configuration file using default properties struts.properties 2010-06-16

    In Struts2 core package (struts2-core-2.0.11.2.jar) There is a file named default.properties (The specific path is org.apache.struts2.default.properties) Struts2 framework contains a number of "default" configuration property. If we are to chang

  • Detailed Struts2 configuration file - struts. Properties 2011-07-19

    This file is the struts2 framework of the global property file is automatically loaded file. This file contains a series of key-value pairs. This file can be configured entirely in struts.xml file, use the constant elements. Here is the file in some

  • Java Zero Configuration Xiang Jie (2) 2010-07-30

    The other configuration as follows: Using our example from above, the XWork package for our action would be: The example above, action corresponding XWORK package are as follows: XWork package naming com.example.actions # / # conventionDefault Annota

  • Struts2 in several properties and xml configuration files 2010-03-29

    Struts2 in several properties and xml configuration files in the form of placement, role, fear forget, be a notebook first 1, struts.properties placed in the src directory 2, application-level resource file internationalization messageResource_en_US.

  • struts.properties defined in the i18n resource file 2009-08-16

    Q: struts.properties defined i18n resource file, can be divided into several modules according to the system resource file, not all written in one instance messageResource.properties in??? -------------------------------------------------- ----------

  • struts.xml and struts.properties configuration Xiangjie 2008-10-01

    Struts 2 framework has two key configuration files: struts.xml and struts.properties One struts.xml document management applications is mainly responsible for the Action mapping, as well as the definition of Action contained in the Result. In additio

  • struts.properties crude solution 2010-04-24

    Reprinted: http://fratemity1314.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=cat% 3DStruts2 struts.configuration (default: org.apache.struts2.config.DefaultConfiguration) Struts 2 configuration file specified load the config

  • struts-default.xml, struts.xml, struts.properties file Xiangjie 2010-09-23

    ( Transfer from ) Each study a framework, we will inevitably learn something about the configuration file, struts2 no exception, here I talk about several major struts2 configuration file. 1) struts-default.xml This file is the struts2 framework of t

  • Struts.properties 2010-06-12

    Struts2提供了很多可配置的属性,通过这些属性的设置,可以改变框架的行 为,从而满足不同的Web应用的需求.这些属性可以在Struts.properties文件中进行设置,struts.properties是标准的 Java属性文件格式,"#"号作为注释字符,文件由键(Key)-值(value)对组成,struts2的属性为键,属性的值为值. struts.properties文件必须位于classpath下,通常放在Web应用程序的/WEB-INF/classes目录下. str

  • Java, equals () and hasCode () method of Xiang Jie 2010-03-29

    1, Java in the equals () and hasCode () method of Xiang Jie Web Address: http://www.blogjava.net/onejavaer/archive/2009/02/22/101536.html http://topic.csdn.net/u/20080421/17/51b2a8e6-e057-4694-a6e3-880d6fe55367.html 2, dialogue to explain: http://hi.

  • java in the hashcode () and equals () of the Xiang Jie [change] 2009-07-20

    java in the hashcode () and equals () of the Xiang Jie [change] October 30, 2008 Thursday, 11:23 PM Research this afternoon for a long time hashcode () and equals () method, finally had a little bit to understand, write down and share 1. First of equ

  • Apache + Tomcat cluster configuration Xiang Jie (2) 2010-03-28

    Apache + Tomcat cluster configuration Xiang Jie (2) 4, Tomcat configuration If only available to configure a cluster, Tomcat configuration will be very simple. Open the t1 and t2 respectively, the server.xml configuration file, for t1, the default se

  • Xiang Jie Javascript in Url encoding / decoding, the form submission URL encoding problem 2010-07-22

    Xiang Jie Javascript in Url encoding / decoding, the form submission URL encoding problem Xiangjie Javascript in Url encoding / decoding URI Abstract targeted codec related problems have been described, on which characters need to Url encoding encodi

  • Xiang Jie Linux system PATH environment variable path modification method 2010-09-06

    Transfer from: http://os.51cto.com/art/200912/168844.htm Xiang Jie Linux system PATH environment variable path modification method Computer operating system, the brain is essential. The very rapid development of Linux, there is a trend catching up Mi

  • Xiang Jie phpexcel export excel (support excel2003, excel2007) + number of sheet (according to one press tab to export) 2010-09-26

    Statistics by time period the work of all employees log, export to excel (support 2003,2007), according to one press tab to export. Complete example, here is the code, if insufficient, the hope that a message exchange. Annex is the complete code and