ResultList是一个List<Class>集合,我只是这个集合长度为0的时候不显示,长度大于0的时候显示。c:if我已经删掉了。
到底该怎么写?<table>
<c:forEach items="ResultList" var="row" step="1">
<tr>
<td align="center"><span><c:out value="${row.SQueryIDCode}"/></span></td>
<td align="center"><span><c:out value="${row.SQueryName}"/></span></td>
<td align="center"><span><c:out value="${row.SQuerySex}"/></span></td>
<td align="center"><span><c:out value="${row.SQueryNationality}"/></span></td>
<td align="center"><span><c:out value="${row.SQueryBirthDate}"/></span></td>
<td align="center"><span><c:out value="${row.SQuerySCode}"/></span></td>
</tr>
</c:forEach>
</table>
到底该怎么写?<table>
<c:forEach items="ResultList" var="row" step="1">
<tr>
<td align="center"><span><c:out value="${row.SQueryIDCode}"/></span></td>
<td align="center"><span><c:out value="${row.SQueryName}"/></span></td>
<td align="center"><span><c:out value="${row.SQuerySex}"/></span></td>
<td align="center"><span><c:out value="${row.SQueryNationality}"/></span></td>
<td align="center"><span><c:out value="${row.SQueryBirthDate}"/></span></td>
<td align="center"><span><c:out value="${row.SQuerySCode}"/></span></td>
</tr>
</c:forEach>
</table>
ResultList,你确定是这么写的?不会是resultList吧
但是display:table已经设置了如果集合为空时,则显示“数据为空”
不为空时,则显示数据。我就是不想集合为空显示"数据为空"的信息,所以才用的c:forEach
<!--<c:forEach>标签用快捷键打出来,是不是中文的尖括号啊。 -->
<c:forEach var="allWd" items="${allWdList}" varStatus="list">
<tr>
<td width="3%">${list.count }</td>
<td width="15%">${allWd.appNo }</td>
<td width="10%">
</td>
<td width="17%"><fmt:formatDate value="${allWd.acceptTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td width="10%">${allWd.serUser }</td>
<td width="10%">
<c:choose>
<c:when test="${allWd.currentNodes eq '01'}">报修受理</c:when>
<c:when test="${allWd.currentNodes eq '02'}">抢修调度</c:when>
<c:when test="${allWd.currentNodes eq '03'}">处理反馈</c:when>
<c:when test="${allWd.currentNodes eq '04'}">报修处理</c:when>
<c:when test="${allWd.currentNodes eq '05'}">完结</c:when>
<c:otherwise></c:otherwise>
</c:choose>
</td>
<td width="10%">${allWd.linkMan }</td>
<td width="25%">${allWd.linkmanAddr }</td>
</tr>
</c:forEach> "allWd"是给集合中的每个对象起的别名,"allWdList"是从action传过来的集合,"list"是循环状态,用以获取比如当前循环的数据的下标等属性