1
我的Web程序配置是Struts2和Tomcat 6.0。Struts2 ActionSupport getTexts()不工作
和我的项目是支持i18n的(国际〜)
我用类扩展com.opensymphony.xwork2.ActionSupport
。
getText(String)
方法有效,但getTexts()
不起作用。
public class MyAction extends ActionSupport {
public void textString() {
// print "en" works
String strTemp1 = getText("CURRENT.LOCALE");
System.out.println(strTemp1);
// This doesn't; bundle is null.
ResourceBundle bundle = getTexts();
System.out.println(bundle);
}
}
globalMessage_en.properties
CURRNET.LOCALE = en
你可以提供详细信息,如何访问that.generally getTexts()获取与实现类相关的资源包(通常是一个操作)。 –
属性文件中的'CURRENT.LOCALE'拼写错误是否为拼写错误?另外,你如何在S2配置中声明全局消息资源? –
Thx确实有帮助 – afraxas