JSP +SERVLET 不用標籤
限制:頁面需要用ftl
zai freemarker中使用下拉框 selection來提供後臺查詢出的數據給用戶選擇
以時間段爲例。
id time
1 0:00-1:00
2 1:00-2:00
...
通過sql語句查詢出數據對象(select id ,time from xxx where xxx )
<select id="timeid" name="timeid" >
<option value="-1">請選擇時段</option>
<#list sdList.items as sd>
<option value="${sd.id!""}" <#if (sd.id==mxtxt.timeid)> selected</#if>>${sd.mxtime!""}</option>
</#list>
</select>