案例:
select latnid from t_latn;
查询出来的结果为:
0
51
52
53
54 .........
页面想用下拉列表迭代这个结果集,结果集封装成list--->map的形式。
jsp 页面的迭代形式为:
<html:select property="form_latnid" styleClass="select" onchange="">
<html:option value="-1">---请选择---</html:option>
<logic:notEmpty name="latnidList">
<html:options collection="billcycleList" property="LATNID" labelProperty="LATNID" /> </logic:notEmpty>
</html:select>
select latnid from t_latn;
查询出来的结果为:
0
51
52
53
54 .........
页面想用下拉列表迭代这个结果集,结果集封装成list--->map的形式。
jsp 页面的迭代形式为:
<html:select property="form_latnid" styleClass="select" onchange="">
<html:option value="-1">---请选择---</html:option>
<logic:notEmpty name="latnidList">
<html:options collection="billcycleList" property="LATNID" labelProperty="LATNID" /> </logic:notEmpty>
</html:select>
本文介绍了一种从数据库中查询特定字段并将其封装为list到map格式的方法,以便于前端页面通过下拉列表的方式进行展示。具体实现了将查询结果转换为可供HTML选择器使用的格式。
564

被折叠的 条评论
为什么被折叠?



