码迷,mamicode.com
首页 > Windows程序 > 详细

JSTL标签API(c)的使用

时间:2014-12-30 13:19:27      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:

后台传数List,在jsp接收以${group.code }
List<Staff> groups = staffService.getStaffsByName("", "",ZD,"G", 0, 1000);
model.addAttribute("groups", groups);


List<StaffRight> rights = staffRightService.getStaffRights();
model.addAttribute("rights", rights);

 

******************************************************************************
<td class="content" colspan="3">
<div class="area" style="position:relative;">
<c:if test="${!empty groups }">
<dl>
<c:forEach items="${groups }" var="group">
<dd>
<input type="checkbox" value="${group.code }" id="${group.code }" name="staff_code" />
<label for="${group.code }">${group.code }-${group.name1 }</label>
</dd>
</c:forEach>
</dl>
</c:if>
</div>
</td>


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


<td class="content" colspan="3">

<c:if test="${!empty rights }">
<ul>
<c:forEach items="${ rights }" var="right">
<li>
${right.desc }:
<c:choose>
<c:when test="${right.type==‘0‘ }">
<input type="radio" value="1" id="can${right.code }" name="${right.code }" />
<label for="can${right.code }">能</label>
<input type="radio" value="0" id="cannot${right.code }" name="${right.code }" checked />
<label for="cannot${right.code }">不能</label>
</c:when>
<c:when test="${right.type==‘1‘ }">
<select name="${ right.code }">
<c:forEach begin="0" end="9" step="1" var="grade">
<option value="${ grade }">${ grade }</option>
</c:forEach>

</select>
</c:when>
<c:otherwise>
<input type="text" name="${ right.code }" value="0" style="text-align:right; width:50px;" />
</c:otherwise>
</c:choose>
</<li>
</c:forEach>
</ul>
</c:if>
</td>

JSTL标签API(c)的使用

标签:

原文地址:http://www.cnblogs.com/OP-RONG/p/4193337.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!