本文介绍了Struts select标签本地化实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下是我的 JSP 文件中 标记的 Struts 代码.
Following is the Struts code for the <s:select>
tag in my JSP file.
<s:select name="choice" list="{'Add to My List','Remove from My List','Activate','Deactivate','Print'}" theme="xhtml" cssClass="text" required="false"/>
我需要将列表元素本地化为法语,如下所示.
I need to localize the list elements to French as shown below.
<s:select name="choice" list="{'Ajouter à Ma liste','Enlever de ma liste','Activer','Désactiver','Imprimer'}" theme="xhtml" cssClass="text" required="false"/>
我如何使用国际化和本地化属性文件来实现这一点.问候
How can I achieve this using the Internationalization and localization properties files.Regards
推荐答案
在你的属性文件中放置方程:
At your properties file place that equations:
addTolist = Ajouter à Ma liste
removeFromList = Enlever de ma liste
...
在 Java 方面,您可以通过以下方式联系他们:
At Java side you can reach them with:
listValue=getText("addTolist");
...
所以,在 jsp 端试试:
So, at jsp side try that:
<s:select ... listValue="%{getText(addTolist)}, ..." ... /> // You should fill the '...' places
这篇关于Struts select标签本地化实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!