After reading this article, the traversal of the front end collection, you can basically handle 90%.
1, rows=list<product>
The list contains entities, the most common, not explained.
<c:foreach items= "${requestscope.rows}" var = "item" ><tr><td>${item.productname}</td> </ Tr> </c:forEach>
2, rows=list<map<string,object>>
The list contains a map, compared to the above, the element does not exist in the form of the entity field, but in the form of a map key value pairs exist. Traverse in exactly the same way as above.
<c:foreach items= "${requestscope.rows}" var = "item" ><tr><td>${item.productname}</td> </ Tr> </c:forEach>
3, rows=list<list<product>>
list, which is generally used for the interface to display a number of different products, each product is a list. Compared to the above, there is a layer of loops.
<c:foreach items= "${requestscope.rows}" var = "itemList" > <table class= "contenttable" width= "1000" Border= "0" cellpadding= "0" cellspacing= "0" > <c:foreach items= "${itemlist}" var = "item" > <tr> <td>${item.productname}</td> </tr></c:forEach> </table> </c:foreach >
4, the first selected rows=list<product>
The first product is selected by default.
<c:foreach items= "${requestscope.rows}" var = "itemList" varstatus= "st" > <c:choose> <c:when Test= "${st.index ==0}" > <div class= "fq_boxs fl selected" > <p class= "Termname" > Sub ${ Itemlist.term} period <span class= "Termtip" > 0 interest </span> </p> </div> </c: when> <c:otherwise> <div class= "Fq_boxs fl" > <p class= "Termname" > Sub ${ Itemlist.term} period <span class= "Termtip" > 0 interest </span></p> </div> </c:o therwise> </c:choose> </c:forEach>
The World martial arts, only fast not broken. Knowledge is not easy, be good at summing up.
Jstl Tag Collection Traversal summary