我有一个 Bottles 对象列表,我成功地显示在下拉列表中,如下所示:
<s:select name="bottle.fileName" multiple="false" list="bottles" listKey="fileName" listValue="displayName" />
这里的瓶子 list 很好。但我想将“SELECT”选项显示为下拉列表中的第一个值。
怎么做?
最佳答案
Refer this Link 我认为这个答案会对你有所帮助。
正如 sree 评论中提到的:
headerKey and headerValue is the answer
<s:select headerKey="-1" headerValue="Select Bottle" name="bottle.fileName" multiple="false" list="bottles" listKey="fileName" listValue="displayName" />
关于java - 如何在下拉列表struts 2中添加 'SELECT'选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20834841/