这是调用的页面<%@page contentType="text/html; charset=GBK"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>
<title>jsp1</title>
</head>
<body bgcolor="#ffffff">
<h1>
<bean:message key="label.welcome.year"/>
</h1>
</body>
</html>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>
<title>jsp1</title>
</head>
<body bgcolor="#ffffff">
<h1>
<bean:message key="label.welcome.year"/>
</h1>
</body>
</html>
还有一个东西不明白
就是
怎么实现一个按扭的单击事件
而将他实现中英文的转换呢 而不用手动的改变
工具→internet选项→语言 而改变他的 语言用事件实现 麻烦指点一下 感激不尽
Locale l=this.getLocale(request);
l=new Locale(languageForm.getLanguage(),"");//得到你所选的语言
request.getSession().setAttribute(Globals.LOCALE_KEY,l);//保存到Session里
<html:select property="language">
<html:option value="en">English</html:option>
<html:option value="zh">Chinese</html:option>
</html:select>
<html:submit>Change</html:submit>
</html:form>public class LanguageForm extends ActionForm {
private String language; // getter & setter
}
然后对应的Action里面:
Locale l = new Locale(languageForm.getLanguage());
setLocale(request, l);
2年以上J2ee java工作经验以上的