Struts2 Study Notes 2 ----- Struts2 in constant (ie, default.properties file) Xiangjie

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

The struts2-core-2.1.8.1.jar/ora.apache.struts2/default.properties can see a lot of Struts2's constant, when you change some constants in the development contribute to the development. Sometimes programs also need to change inside the constant: So to understand the meaning of these constants is very important (but if you very good English, then skip directly to the property file on the list):

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 or UTF-8.
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. Only the name, type, auto, and constructor of these four values
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. 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, this will automatically load the configuration file. When entering 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, when you will be the global resource file is configured with an international Under a package is to change the property must be designated to that package the next.
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.

Development time, we sometimes need to change these attributes. To this end Struts2 provides many ways to change these attributes, the following commonly used in two ways:

The struts.xml Change:

<constant name="struts.devMode" value="true"> </ constant>

In the web.xml file, change:

<filter>

<filter-name> struts2 </ filter-name>

<filter-class>

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

</ filter-class>

<init-param>

<param-name> struts.devMode </ param-name>

<param-value> true </ param-value>

</ init-param>

</ filter>

<! - EndFragment ->

<! - EndFragment ->

相关文章
  • Struts2 Study Notes 2 ----- Struts2 in constant (ie, default.properties file) Xiangjie 2010-03-29

    The struts2-core-2.1.8.1.jar/ora.apache.struts2/default.properties can see a lot of Struts2's constant, when you change some constants in the development contribute to the development. Sometimes programs also need to change inside the constant: So to

  • Struts2 Study Notes 3 ----- Struts2 configuration and Struts2 in a constant search of the order of constant 2010-03-29

    In Struts you can configure the constants in the following documents: default.properties files (there are a lot of constants) struts-default.xml struts-plugin.xml struts.xml struts.properties (in order to provide backward compatibility with the webwo

  • Struts2 study notes (c) Struts2 access request, session, and application objects 2010-10-14

    Access request, session, and application objects Struts2 provides a variety of ways to access the request, session, application three kinds of objects, can be summed up, can be divided into two categories, with the Servlet API decoupling mode and cou

  • Struts2 study notes (b) Struts2 user client access to the three input methods 2010-10-14

    Struts2 user client access to the three input methods: 1. Using the domain object to receive user input: The first method, you need to jsp page like this: <table> <tr> <td> User Name: </ td> <td> <input type="text&quo

  • Struts2 study notes (d) Struts2 Framework Analysis 2010-10-23

    Struts2 framework for analyzing when a HTTP request arrives Struts2's FilterDispatcher, will be transformed into action command. The action command through a series of in Struts2 and XWork interceptor, the final implementation of the Action class of

  • Struts2 Study Notes 1 --- HelloWorld 2010-03-24

    Struts2 study notes first: environmental structures and the HelloWorld implementation. 1, build Struts2 environment. The Myeclipse years to create a new WEB projects, I named: Struts2_01. As the use of some Struts, libraries, and here I had a new use

  • Struts2 Study Notes 2010-03-29

    1. Struts2 seems little kinship with Struts1, and commitments from in WebWork, direct harm WebWork is no longer a new version of the original WebWork users only need to shun their natural, that is, drainage into the watercourse; on the contrary Strut

  • Sun look, I used to struts2 Study Notes 2010-05-26

    struts2 interceptor configuration example <struts> <package name="testInterceptor" extends="struts-default"> <! - All the interceptors and interceptor stacks are defined under this element -> <interceptors> <

  • struts2 study notes the method attribute-action 2010-06-27

    This article mainly focused on "struts2 Study Notes-Action of the configuration and the basic application and principle of" Action methods on the part of the article in the supplement and the use of Xiang Jie, you reading this article, please pa

  • struts2 study notes + test source code 2010-07-11

    Learning struts2 test code Are used before struts1, now want to study under the struts2, in the learning process, feel struts2 much better than struts1, so I spent two days learning to write a point when the test code, hoping to help the beginner str

  • [Zhang Bing Struts2 study notes] 0403.struts.xml Detailed configuration of the three-block configuration 2010-11-25

    Detailed configuration of the three struts.xml interceptor configuration 1. Interceptor (Interceptor) configuration Interceptors to be called in action before and after being called to perform some "code." Struts2 framework for most of the core

  • 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 properties file Xiangjie 2010-03-29

    struts.configuration This attribute specifies the Struts 2 configuration file loads the configuration file manager. The property's default value is org.apache.Struts2.config.DefaultConfiguration, which is Struts 2 default configuration file manager.

  • Struts2 Study Notes 1 2010-03-24

    Recent use the Struts2 will study strtus2 1. First download a Struts2 http://struts.apache.org download a Struts2 2. Create a new web project Add the following package commons-fileupload-1.2.1.jar, freemarker-2.3.15.jar, ognl-2.7.3.jar, struts2-core-

  • Struts2 Study Notes 2 --- profile 2010-04-12

    In Struts2 in two main configuration files: web.xml and struts.xml, when a new web project, you can sample from the Struts2 copy of the program, and then make the appropriate modifications. The basic form of web.xml as follows: <web-app version="2

  • [Zhang Bing Struts2 study notes] 0104_Action interface ActionSupport class 2010-11-16

    ActionSupport Class Action interface 1. Action Interface The package name : com.opensymphony.xwork2 Description : public interface Action All actions may implement this interface, which exposes the execute() method. However, as of XWork 1.1, this is

  • struts2 study notes eleven (Lecture 11. Struts2 core interceptor continued) 2011-01-14

    The core Struts2 interceptor continued <br /> Description: The main function of the interceptor is to intercept Action, execution order is: interceptor -> Action-> interceptor -> ... .... Function: The basic configuration of the interceptor

  • Struts2 study notes --- DMI (dynamic method invocation) 2011-05-05

    We can use with the action of the method to call a method, but can also use DMI, dynamic method invocation Action performed when the execute method does not have to perform in the config file when using method = Action to specify which method can als

  • Struts2 Study Notes 1 ----- build and test environments 2010-03-29

    1.Struts2 environment structures: The development of pre-prepared Struts2 package: * Available from: http://struts.apache.org/2.x/ for download * Download the Full Distribution: o struts-2.1.8.1-all.zip (110mb) [ PGP ] [ MD5 ] Started building enviro

  • Struts2 study notes (a) set up the environment and the HelloWorld program 2010-10-14

    Struts2 first experience 1, you need to configure Struts2 Web.xml file filters FilterDispatcher. Web.xml configured in the complete code is as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xm