"c forEach "如何迭代数组.
  如何将 list 中保存的 数组 迭代出来...?

解决方案 »

  1.   

    没太看明白你的意思,是迭代还是遍历,是遍历list,找出其中的数组,还是遍历数组中的每个元素?遍历数组和list类似 <% String[] words = { "foo", "bar", "baz"}; 
    pageContext.setAttribute("words", words); 
    %> 
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> 
    <H2>Key Words:</H2> 
    <UL> <c:forEach var="word“ items="${words}"> 
    <LI><c:out value="${word}"/> </c:forEach> 
    </UL> 
      

  2.   

    将list中的数组中的元素迭代出来. 嘿嘿...
      

  3.   

    action:
    request.setAttribute("mylist",list);jsp:
    <c:forEach  items="${mylist}" var="user">
         ${user.name}
         ${user.xxx}
    </<c:forEach>
      

  4.   

    就像三楼的那样 ,items里面放list,var里放的是每次取出的结果,
    然后通过var里的对象 .(点)出来你要的东东,就行了。
      

  5.   

        <c:forEach items="${productlist}" var="product" varStatus="status">
    <tr>
    <input name="product_id"  type="hidden" value="${product.id}"/>
    <td class=tablebody2 valign=middle align=center width="">${status.count}</td>
    <td class=tablebody1 valign=middle width="">&nbsp;&nbsp;<a href="${pageContext.request.contextPath }/product/manager/toDetail.do?product_id=${product.id }">${product.name }</a></td>
    <td class=tablebody2 valign=middle align=center width="">${ product.basePrice}</td>
    <td class=tablebody1 valign=middle align=center width=""><a href="${pageContext.request.contextPath }/cart/manager/add.do?product_id=${product.id }">
    <img border="0" src="${pageContext.request.contextPath }/images/car_new.gif" width="97" height="18"></a> </td>
    </tr>
                </c:forEach>