代码如下:使用的是jstl1.2 
list中总共有三个对象 可是运行时 只是输出了最后一个对象 用staa.count查看 循环只进行了一次 
大家帮我看看为什么 谢谢了<c:forEach items="${list}" var="list" varStatus="staa">
<tr>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.noteid }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.membername }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.bookname }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.booktype }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.bookprice }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.bookconcern }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.booklocation }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.lendtime }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.returntime }</span></font></th>
<th width="10%"><font color="#3e8e88"><span style="font-weight: normal;">${list.amerce }</span></font></th>
</tr>
</c:forEach>

解决方案 »

  1.   

    varStatus="staa"可以不需要。
    建议你判断下list的对象个数,如果大于1,你就打印,
    看有没有打印,若是还打印了,说明你那list确实有3个对象,不过应该不会出现这样
    的状况。
    建议items="${list}" var="list"改成items="${list}" var="l"试试。
      

  2.   

    <c:forEach items="${list}" var="list" varStatus="staa"> 
    var="item"名字尽量和list不一样试下!一般直接看代码是没错的!
    除非是你查询的时候只查到了一条,一般情况下就不可能就只有一条。
    仔细检查下查询的代码!
      

  3.   

    list里确实有三个对象……不知道为什么这个循环只输出了最后一个对象的所有参数……
      

  4.   


    <c:forEach items="${list}" var="item" > 
    <tr> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.noteid } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.membername } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.bookname } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.booktype } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.bookprice } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.bookconcern } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.booklocation } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.lendtime } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.returntime } </span> </font> </th> 
    <th width="10%"> <font color="#3e8e88"> <span style="font-weight: normal;">${item.amerce } </span> </font> </th> 
    </tr> 
    </c:forEach>这里保证list是个集合,item是list里的元素。。
      

  5.   

    语法体系就有问题!th可是表头,td 应该!items="${list}" var="list"  别用同名。 list命名 是唯一的么?