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>

解决方案 »

  1.   

    <c:forEach items="${ResultList}" var="row"> 
      

  2.   

    我这样写的话,就提示Don't know how to iterate over supplied "items" in &lt;forEach&gt;
      

  3.   

    后台传的不是  ResultList吧。     看看名字
      

  4.   

    不知道怎么迭代提供的items
    ResultList,你确定是这么写的?不会是resultList吧
      

  5.   

    ResultList这个是什么东东啊。还大写很奇怪
      

  6.   

    我确定传的是ResultList,用display:table可以显示。
    但是display:table已经设置了如果集合为空时,则显示“数据为空”
    不为空时,则显示数据。我就是不想集合为空显示"数据为空"的信息,所以才用的c:forEach
      

  7.   

    List集合怎么不对?请详细指出
      

  8.   

    自己定义的一个List<obj>的集合。
      

  9.   

    提示Don't know how to iterate over supplied "items" in &lt;forEach&gt;
      

  10.   

    <c:forEach items="${ResultList}" var="row">
    <!--<c:forEach>标签用快捷键打出来,是不是中文的尖括号啊。 -->
      

  11.   


    <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"是循环状态,用以获取比如当前循环的数据的下标等属性
      

  12.   

    能不能把Action中的方法给我看下...