I want to display the key value bean based on sorting of value in Struts 2(我想根据 Struts 2 中的值排序显示键值 bean)

本文介绍了我想根据 Struts 2 中的值排序显示键值 bean的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据 Struts 2 中的值排序显示键值 bean.

I want to display the key value bean based on sorting of value in Struts 2.

<s:select list="preferredBranchList"  listKey="displayKey"
          listValue="displayValue" name="preferredBranch" 
          cssClass="selectpicker show-tick" required="true"  /> 

它是根据 listKey 对值进行排序.请建议我根据 listValue 对值进行排序.

It's sorting of the values based on listKey. Please, suggest me to sort the values based on listValue.

推荐答案

您可以尝试对 Action 类本身的值进行排序,因此当呈现 select 时,列表将显示为已排序

You can try and sort the values in Action class itself, so when select is rendered the list will appear sorted

这篇关于我想根据 Struts 2 中的值排序显示键值 bean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!