开发者

Struts2 + Internationalization

开发者 https://www.devze.com 2023-02-04 23:51 出处:网络
Is it 开发者_如何学运维possible that when I use the \"getText(\"keyName\"); in action class, I can specify that pick the value from ENGLISH resource bundle ONLY. Because I just want to use this value

Is it 开发者_如何学运维possible that when I use the "getText("keyName"); in action class, I can specify that pick the value from ENGLISH resource bundle ONLY. Because I just want to use this value for logging purposes.

Any thoughts how can I achieve this?

BR SC


You can do what you're looking for with:

LocalizedTextUtil.findDefaultText("keyName", Locale.ENGLISH)

This is a utility class in XWork (Struts2) that handles localization.


see these examples for struts internationalization link1,link2 These examples are given using struts1, with some simple modification, you can use them for struts2

0

精彩评论

暂无评论...
验证码 换一张
取 消