日期:2014-05-20 浏览次数:20901 次
<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>