You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2022/09/15 05:45:00 UTC
[jira] [Closed] (WW-3561) Struts2.1.8 use Tiles not to support chinese(Internationalization I18n)
[ https://issues.apache.org/jira/browse/WW-3561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart closed WW-3561.
-----------------------------
Resolution: Fixed
> Struts2.1.8 use Tiles not to support chinese(Internationalization I18n)
> ------------------------------------------------------------------------
>
> Key: WW-3561
> URL: https://issues.apache.org/jira/browse/WW-3561
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.1.8
> Environment: Windows XP, Eclipse, Tomcat6.0.14, Struts2.1.8, Maven
> Reporter: keming.hu
> Priority: Major
> Fix For: 6.1.0
>
> Attachments: StrutsHelloWorld.rar
>
>
> When I use struts2-core-2.1.8.jar and struts2-tiles-plugin-2.1.8.jar to test a jsp which it needs I18n support for chinese, there are ApplicationResources_en_US.properties and ApplicationResources_zh_CN.properties in classpath. If I use tiles, for example
> <s:textfield name="userName" key="label.username" id="userName" />
> The chinese will be produced disorder code (???) in the page
> I use this command native2ascii -encoding UTF-8 a.txt ApplicationResources_zh_CN.properties. And all jsps adopt uniform charset (utf-8)
> <%@ page contentType="text/html; charset=UTF-8 pageEncoding="UTF-8"%>
> Please refer to the following Struts.xml
> <struts>
> <constant name="struts.enable.DynamicMethodInvocation"
> value="false" />
> <constant name="struts.devMode" value="false" />
> <constant name="struts.custom.i18n.resources"
> value="ApplicationResources" />
> <package name="default" extends="struts-default" namespace="/">
> <result-types>
> <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult" />
> </result-types>
> <action name="login"
> class="net.viralpatel.struts2.LoginAction">
> <result name="success" type="tiles">/welcome.tiles</result>
> <result name="error">Login.jsp</result>
> </action>
> <action name="customer"
> class="net.viralpatel.struts2.CustomerAction">
> <result name="success" type="tiles">/customer.success.tiles</result>
> <result name="input" type="tiles">/customer.tiles</result>
> </action>
> <action name="customer-form">
> <result name="success" type="tiles">/customer.tiles</result>
> </action>
> </package>
> </struts>
> But when I do not use tiles, these jsps will display correctly
> Please refer to the Struts.xml
> <struts>
> <constant name="struts.enable.DynamicMethodInvocation"
> value="false" />
> <constant name="struts.devMode" value="false" />
> <constant name="struts.custom.i18n.resources"
> value="ApplicationResources" />
> <package name="default" extends="struts-default" namespace="/">
> <action name="login"
> class="net.viralpatel.struts2.LoginAction">
> <result name="success">Welcome.jsp</result>
> <result name="error">Login.jsp</result>
> </action>
> <action name="customer"
> class="net.viralpatel.struts2.CustomerAction">
> <result name="success" >Customer.jsp</result>
> <result name="input">Customer.jsp</result>
> </action>
> <action name="customer-form">
> <result name="success">Customer.jsp</result>
> </action>
> </package>
> </struts>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)