struts2 jsp如何显示list中的list中的数据。
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="/struts-tags" prefix="struts" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<jsp:include flush="true" page="header.jsp"></jsp:include>
<div class="contentwrap z">
<struts:iterator var="category" value="categorylist">
<div class="t">
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<th class="h" colspan="6">
<a class="closeicon fr" style="cursor:pointer;" onclick="return IndexDeploy('85',0)">
<img id="img_85" src="images/yellow/index/cate_fold.gif" />
</a>
<h2>
<a href='<struts:url action="listCategory"/>?categoryfm.id=${ category.id}' class="cfont">
${category.name}
</a>
<c:if test="${category.id != null}">
<a href='<struts:url action="initaddBoard"/>?categoryId=${ category.id}' class="cfont">
增加版面
</a>
</c:if>
</h2>
</th>
</tr>
<tr></tr>
<tr class="tr2">
<td width="*" colspan="2" class="tac">论坛</td>
<td class="tal y_style e" style="width:5%">主题</td>
<td class="tal y_style e" style="width:5%">文章</td>
<td class="tal y_style f" style="width:39%">最后发表</td>
<td class="y_style" style="width:10%">版主</td>
</tr>
<tbody id="cate_85" style="display:;">
<struts:iterator var="board1" value="category.boards">
<tr class="tr3 f_one" >
<td class="icon tac" width="45">
<a href='<struts:url action="listBoard"/>?board.id=${board1.id }'>pic
</a>
{board1.name }
</td>
<th>
<h3 class="b">
<a href='<struts:url action="listBoard"/>?board.id=${board1.id }'>${board1.name }
</a>
</h3>
<br/>
<span class="smalltxt gray">${board1.description} </span>
</th>
<td class="tal y-style e">
<span class="f10">${board1.threadCount}
</span>
<br/>
</td>
<td class="tal y-style e">
<span class="f10">${board1.replyCount}
</span>
<br/>
</td>
<th>
<c:if test="${board1.lastThread != null}">
<a>
</a>
<br/>
<span class="f12">
<a> </a>
</span>
<span class="f9 gray">${board1.lastThread.dateCreated}
</span>
</c:if>
<c:if test ="${board1.lastReply != null}">
<a ></a>
<br/>
<span class="f12">
</span>
<span class="f9 gray">${board1.lastReply.dateCreated}</span>
</c:if>
</th>
<td class="y_style" style="word-break:keep-all;word-wrap:no-wrap">
<struts:iterator var="person" value="board.administrators">
<a> </a>
</struts:iterator>
</td>
</tr>
</struts:iterator>
<tr>
<td class="f_one" colspan="6" style="height:8px">
</td>
</tr>
</tbody>
</table>
</div>
</struts:iterator>
<div>
<a href="<struts:url action = "initaddCategory"/>" >添加类别</a>
</div>
</div>
<jsp:include flush="true" page="footer.jsp"></jsp:include>
上面的代码没有语法错误,category的数据可以正常显示
但是内层的category.boards中的数据没有显示出来,不知道为什么?
在action中可以看到,categorylist的category对象的boards中是有数据的。