请看下面的内容#LocalStrings_zh_CN.propertiespage.title=国际化form.label=请输入你的姓名form.button=提交中文繁体版:#LocalStrings_zh_TW.propertiespage.title=國際化form.label=請輸入您的姓名form.button=提交英文版:#LocalStrings_tw.propertiespage.title=internationalizationform.label=Please enter your nameform.button=submitLocalStrings_zh_CN.properties、LocalStrings_zh_TW.properties和LocalStrings_tw.properties这三个文件均以系统缺省的编码方式保存。form.jsp改成:<%@ page contentType="text/html;charset=utf-8"%><%@ page import="beans.LocaleStrings"%><%LocalStrings lss = new LocalStrings("LocalStrings", request.getLocale());%><html>  <head>    <title><%=lss.getString("page.title")%></title>  </head>  <body>    <form method="POST" action="test.jsp">      <label><%=lss.getString("form.label")%></label>      <input type="text" name="name" size="20">      <input type="submit" value="<%=lss.getString("form.button")%>">    </form>  </body></html>beans.LocalStrings的源文件如下:package beans;import java.util.ResourceBundle;import java.io.UnsupportedEncodingException;import java.util.Locale;public class LocalStrings{       protected ResourceBundle rb;       protected boolean encoded;       public LocalStrings(String baseName, Locale locale)       {              this.rb = ResourceBundle.getBundle(baseName, locale);              if(locale.getCountry().equals("CN") || locale.getCountry().equals("TW"))                     encoded = true;       }       public String getString(String key)       {              String value = rb.getString(key);              if(encoded)              {                     try                     {                            byte bs[] = value.getBytes("ISO-8859-1");                            return new String(bs, "GBK");                     }                     catch(UnsupportedEncodingException uee)                     {                            return value;                     }              }              return value;       }}从浏览器访问form.jsp,我们应该看到正确的输出,然后通过浏览的Internet选项,将浏览器的语言设置成“中文(台湾)[zh-tw]”,再访问form.jsp,我们就能看到繁体字的提示信息了;再将浏览器语言设置成“英语(美国)[en-us]”,再访问form.jsp。为什么要用LocalStrings到重新编码这些字符串呢,查看ResourceBundle的源程序可以发现,它读取文件中时,并没有对字符串进行编码,所以我们不得不在LocalStrings中对使用正确的编码对这些区域相关的字符串编码
我不明白的是 3个properties文件LocalStrings_zh_CN.properties、LocalStrings_zh_TW.properties和LocalStrings_tw.properties
<%LocalStrings lss = new LocalStrings("LocalStrings", request.getLocale());%>要读取的是LocalString.properties文件 可是根本没有这个文件 只有LocalStrings_zh_CN.properties、LocalStrings_zh_TW.properties和LocalStrings_tw.properties这3个文件啊  难道说是这3个文件中都包含LocalStrings字符串 根据程序来看,使用<%LocalStrings lss = new LocalStrings("LocalStrings", request.getLocale());%>可以根据情况来选择读取对应3个properties中的一个
是这样理解的吗 请高手指点一下 实在是不明白