Struts2 + Internationalization

Is it possible that when I use "getText (" keyName "), in the action class I can indicate that I have selected a value only from the English resource package. Because I just want to use this value for logging purposes.

Any thoughts how I can achieve this?

BR SC

+4
source share
2 answers

You can do what you are looking for:

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

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

+4
source

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

0
source

Source: https://habr.com/ru/post/1335381/


All Articles