首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

c:foreach标签该如何用

2012-03-31 
c:foreach标签该怎么用?ResultList是一个ListClass集合,我只是这个集合长度为0的时候不显示,长度大于0的

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>                                    </c:choose>                                </td>                                <td width="10%">${allWd.linkMan }</td>                                <td width="25%">${allWd.linkmanAddr }</td>                            </tr>                        </c:forEach> 

热点排行