Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.1.0
-
None
-
Windows 2000 server + JDK1.4.04
-
Patch, Important
Description
Set the language of IE as English. The locale of JVM is zh_CN.
<bean:message key=...> will always fetch localized message from application_zh_CN.properties instead of application.properties.
Please refer to the following script:
****************************************************************************
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page language="java" session="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<html:html locale="true">
<c:set var="localeKey">
<%=org.apache.struts.Globals.LOCALE_KEY %>
</c:set>
<fmt:setLocale value="${sessionScope[localeKey]}"/>
<fmt:setBundle basename="ApplicationResources"/>
fmt1=<fmt:message key="logged.in.txt"/></p>
fmt2=<fmt:message key="app.logon.password.txt"/></p>
bean1=<bean:message key="search.tabBanner.account.txt"/></p>
****************************************************************************
The "fmt:messge" tag output English message, while "bean:message" output Chinese message.
This problem can only be found when locale of JVM is set as "zh_CN" or "zh_TW ".