Constants in Struts

Source: Internet
Author: User

Prior to using struts is the use of myeclipse, so there are many things do not need their own configuration, there is no attention to so much, now using eclipse, found that there are many things are familiar and unfamiliar. For constant tags, I do not seem to use, the most important is the use of <constant name= "Struts.i18n.reload" value= "true"/>, and now a comprehensive summary:


1:struts.i18n.encoding


Specifies the default encoding set for the Web App, which is equivalent to calling HttpServletRequest's Setcharacterencoding method, such as:

<constant name="struts.i18n.encoding" value="UTF-8" />


2:struts.action.extension


This property specifies the request suffix that needs to be processed by Struts 2 , which is the default value of the action, which means that all requests that match *.action are handled by Struts 2 . If the user specifies multiple request suffixes, they are separated by commas, such as:

<constant name="struts.action.extension" value="Do" />


3:struts.objectfactory


This property specifies which container the action in Struts 2 is created in, such as:

<constant name= "struts.objectfactory" value= "Spring"/>


4:struts.i18n.reload


This property sets whether the system reloads the resource file every time the HTTP request arrives. The default value of this property is false. Setting this property to true during development is more beneficial for development, but should be set to false during the product release phase. The product release phase should set this property to False, in order to provide response performance, and each request requires a reload of the resource file to significantly reduce the performance of the application.


5:struts.devmode


This property sets whether the Struts 2 app uses development mode. If you set this property to True, you can display more and more friendly error hints 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 app is set to true during development, and is set to False when the product release phase is entered. Such as:

<constant name= "Struts.devmode" value= "false"/>


6:struts.freemarker.manager.classname


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 the built-in Freemarker manager for Struts 2.


7:struts.custom.i18n.resources


This attribute specifies the Internationalized resource files required by the Struts 2 app, and if there are multiple internationalized resource files, the file names of multiple resource files are separated by commas. Such as:

<constant name= "struts.custom.i18n.resources" value= "Globalmessages"/>


8:struts.configuration.xml.reload


This property sets whether the system reloads the file automatically when the Struts.xml file changes. The default value for this property is false. Such as:

<constant name= "Struts.configuration.xml.reload" value= "true"/>


Feel common also on these, if later encountered other add summary. Constants are usually placed at the beginning of the struts configuration file.

This article is from the "Anja Blog" blog, make sure to keep this source http://xuxy0303.blog.51cto.com/9562154/1602503

Constants in Struts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.