引入jstl
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
1.实现复选框
<td align="left" class="frormbg">
<input type="checkbox" name="works" datatype="*" value="gw" <c:if test="${fn:contains(works, 'gw')}">checked="checked"</c:if> />公文
<input type="checkbox" name="works" value="sw" class="mar_l10" <c:if test="${fn:contains(works, 'sw')}">checked="checked"</c:if> />事务
<input type="checkbox" name="works" value="hy" class="mar_l10" <c:if test="${fn:contains(works, 'hy')}">checked="checked"</c:if> />会议
</td>
2.截串
<td align="left" class="frormbg">${fn:substring(task.createTime, 0, 10)}</td>
3.list长度
<input type="hidden" id="num" name="num" value="${fn:length(pathlist)}" />
4.if-else判断
<c:choose><c:when test='${fn:length(jsoList) > 0 }'>170</c:when><c:otherwise>1</c:otherwise></c:choose>
5.for-each
<c:forEach var="item" items="${requestScope.hdapList}" varStatus="status">
${status.count}序号从1开始
${status.index}序号从0开始
${status.last}最后一个序号
${status.first}第一个序号
<tr>
<td width="170" height="60" align="center"><span class="gray_big">${item.leader}</span></td>
<td align="left">${item.context}</td>
</tr>
</c:forEach>