1.select示例,用于在编辑记录时,可以将select自动选中记录的当前值:
2,select示例,用于在新增记录时,列出存于session里的集合:
<
select name
=
"
model.svType
"
>
< c:forEach items = " ${bugtypeinfoCollection} " var = " bugtypeinfo " >
< c:choose >
< c:when test = " ${bugtypeinfo.auId == buginfo.bugtypeinfo.auId} " >
< option value = ' <c:out value="${bugtypeinfo.auId}"/> '
selected = " selected " >
< c: out value = " ${bugtypeinfo.svName} " />
</ option >
</ c:when >
< c:otherwise >
< option value = ' <c:out value="${bugtypeinfo.auId}"/> ' >
< c: out value = " ${bugtypeinfo.svName} " />
</ option >
</ c:otherwise >
</ c:choose >
</ c:forEach >
</ select >
< c:forEach items = " ${bugtypeinfoCollection} " var = " bugtypeinfo " >
< c:choose >
< c:when test = " ${bugtypeinfo.auId == buginfo.bugtypeinfo.auId} " >
< option value = ' <c:out value="${bugtypeinfo.auId}"/> '
selected = " selected " >
< c: out value = " ${bugtypeinfo.svName} " />
</ option >
</ c:when >
< c:otherwise >
< option value = ' <c:out value="${bugtypeinfo.auId}"/> ' >
< c: out value = " ${bugtypeinfo.svName} " />
</ option >
</ c:otherwise >
</ c:choose >
</ c:forEach >
</ select >
2,select示例,用于在新增记录时,列出存于session里的集合:
<
select name
=
"
model.svType
"
>
< c:forEach items = " ${bugtypeinfoCollection} " var = " bugtypeinfo " >
< option value = ' <c:out value="${bugtypeinfo.auId}"/> ' >
< c: out value = " ${bugtypeinfo.svName} " />
</ option >
</ c:forEach >
</ select >
< c:forEach items = " ${bugtypeinfoCollection} " var = " bugtypeinfo " >
< option value = ' <c:out value="${bugtypeinfo.auId}"/> ' >
< c: out value = " ${bugtypeinfo.svName} " />
</ option >
</ c:forEach >
</ select >