当前位置: 代码迷 >> Java Web开发 >> Struts关于<html:select>的排序解决方案
  详细解决方案

Struts关于<html:select>的排序解决方案

热度:108   发布时间:2016-04-17 12:21:36.0
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里.
  相关解决方案