1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <body> <% Locale locale; String language = request.getParameter("language"); if ("en".equals(language)) { locale = Locale.US; } else if ("zh".equals(language)) { locale = Locale.CHINA; } else { locale = request.getLocale(); } ResourceBundle i18n = ResourceBundle.getBundle("i18n", locale); %>
<a href="index.jsp?language=en">English</a> | <a href="index.jsp?language=zh">中文</a> <br/>
<span><%=new String(i18n.getString("username").getBytes("ISO-8859-1"), "UTF-8")%></span> <span><%=new String(i18n.getString("password").getBytes("ISO-8859-1"), "UTF-8")%></span> </body>
|