`

[解决方案]Struts2 国际化问题之国际化资源文件已经加载,但找不到消息资源KEY

阅读更多
Struts2 国际化问题之国际化资源文件已经加载,但找不到消息资源KEY?

配置如下:
i18n_zh_CN.properties
welcome=欢迎国际化!!!


index.jsp
<%@taglib uri="/struts-tags" prefix="s" %>

<s:text name="welcome" />


struts.xml
<constant name="struts.custom.i18n.resources" value="i18n" />


转码:
C:\>native2ascii -encoding utf-8 C:\i18n_zh_CN.properties C:\i18n.properties



转码后的i18n.properties

\ufeffwelcome=\u6b22\u8fce\u56fd\u9645\u5316!!!


看到这里应该明白为什么找不到KEY welcome了吧.

把\ufeff删除掉就OK啦.

welcome=\u6b22\u8fce\u56fd\u9645\u5316!!!





2
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics