日期:2014-05-18  浏览次数:20712 次

Struts关于<html:select>的排序
问题:我从数据库检索数据出来,要显示到jsp的select下拉菜单中
但问题是-----〉我在数据库中筛选出来的数据是按照id已经排好序放在hashmap中的,但从select显示出来的,确是随机的,并没排好
  有经验的进来看看
Java code

<html:select property="gpname"   onclick="document.getElementById('gname').value=this.options[this.selectedIndex].value;" size="5"  style="width=100%;height=300">  
<html:options collection="gpList" property="key" labelProperty="value"/>
</html:select>




------解决方案--------------------
把VALUE的值放到(有序的集合)TREESET里.