日期:2014-05-17  浏览次数:20771 次

c:foreach标签该怎么用?
ResultList是一个List<Class>集合,我只是这个集合长度为0的时候不显示,长度大于0的时候显示。c:if我已经删掉了。
到底该怎么写?
Java code

<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>



------解决方案--------------------
<c:forEach items="${ResultList}" var="row">
------解决方案--------------------
你的List集合貌似不对啊。
------解决方案--------------------
后台传的不是 ResultList吧。 看看名字
------解决方案--------------------
不知道怎么迭代提供的items
ResultList,你确定是这么写的?不会是resultList吧
------解决方案--------------------
ResultList这个是什么东东啊。还大写很奇怪
------解决方案--------------------
+1
探讨
<c:forEach items="${ResultList}" var="row">

------解决方案--------------------
探讨

引用:

+1引用:
<c:forEach items="${ResultList}" var="row">

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

------解决方案--------------------
HTML code

<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>