前台:
<select id="jq" name="jq" class="tsui" data-required="true">
<option value="">请选择</option>
<#list jqlist as map>
<option value=${map['scenic_id']} >${map['scenic_name']}</option>
</#list>
</select>
后台:
String jp="SELECT f.scenic_id,f.scenic_name FROM f_gy_supplier_scenic_info f";
CachedRowSet crs1 = dg.getRowSet(jp);
List<Map<String, String>> jqlist=new ArrayList<>();
while(crs1.next()){
Map<String,String> map=new HashMap<>();
map.put("scenic_id", crs1.getString("scenic_id"));
map.put("scenic_name", crs1.getString("scenic_name"));
jqlist.add(map);
}
request.setAttribute("jqlist", jqlist);