Struts2 + Internationalization
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
精彩评论