数据库参数读取到列表中?
<select name="sex"> <option value="0" onload="if(<%=sex%>=="0")checked"> 选择您的性别 </option> <option value="男"> 男 </option> <option value="女"> 女 </option></select>
<select name="deptId"> <c:forEach items="${depts}" var="item"> <option value="${item.id}" <c:if test="${当前用户部门id == item.id }">selected</c:if> ${item.name} </option> </c:forEach></select>
[解决办法]
<select name="showList">
<c:forEach items="${List}" var="item">//list加入从数据库读出来来的数据
<option value="${item.id}">
</option>
</c:forEach>
</select>