开发者

using internationalization on list data

开发者 https://www.devze.com 2023-01-20 18:11 出处:网络
i am using Struts2 in application. <s:iterator value=\"listObject\"> <s:component 开发者_C百科template=\"abc.vm\">

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.

0

精彩评论

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

关注公众号