using internationalization on list data
i am using Struts2 in application.
<s:iterator value="listObject">
<s:component 开发者_C百科template="abc.vm">
<s:param name="text" value="listValue" />
<s:param name="prefix" value="listIndex" />
</s:component>
</s:iterator>
listValue is a values of list. i am using iterator to traverse the list. now on listValue, i want to put here internationalization concept.so that all the list value can be display based on Locale which store in a list. please suggest!
As it's explained in the Struts 2 reference, you can use different solutions to suporting internationalization.
I think that the best solution could fit for your requirements could be to use the getText()
method to get the value of the resource bundle of every element of the iterator.
Other easy option can be to set the right localization value in the Action, using the same approach setting the values in the iterator before the control arrives to the UI layer.
精彩评论