The common way that Struts solves coding problems:
The first type:
Create a file struts.properties configuration file under SRC (consistent with the Struts.xml file path),
The contents of the struts.properties are as follows:
<struts.il8n.encoding value= "Utf-8"/>
The second type:
The constants are injected directly into the Struts.xml configuration file as follows:
<struts>
<constant.il8n.encoding value= "Utf-8"/>
</struts>
In fact, as long as the constants can be used in the Struts.xml <constant> tag configuration.
The third type:
when configuring the front-end controller in Web. XML,
The encoding format is injected using the initialization parameters as follows:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
Org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
<init-param>
<param-name> struts.il8n.encoding </param-name>
<param-value> UTF-8 </param-value>
</init-param>
</filter>
Dick Silk code in the agricultural struts from this moral integrity again no garbled history.
This article is from the "You are ITER for bugs Live" blog, please be sure to keep this source http://king2.blog.51cto.com/8746235/1592717
Several ways in which Struts solves coding problems