1:<img src="<%=path%>/images/zh_TW.png"/><p>
<a href="changeLocale.do?locale=zh_TW"><%=Locale.TAIWAN.getDisplayName(Locale.TAIWAN)%></a>
点击超链进入action里,
2:String[] localeNames = request.getParameter("locale").split("_");
Locale locale = Locale.getDefault();得到实例
Locale l1=new Locale(language, country);
locale = new Locale(localeNames[0], localeNames[1]);把得到的多个参数传入,
3:request.getSession().setAttribute(Globals.LOCALE_KEY, locale);存入session里
4:引入struts两个标签库
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
5:在com.xaccp.struts目录下App_zh_HK.properties App_zh_CN.properties等配置文件
6:使用标签库方法
<bean:message key="login.password"/>