Struts 2 iterator tag: tag of iterative data
•
Java
< s: iterator value = "collection element" id = "ID number" status = "instance name" > < s: property / > < br > < / s: iterator >
Example
<body> <table align="center" width="450" border="1"> <tr> <td align="center" colspan="5"> <h2>所有图书信息</h2> </td> </tr> <tr align="center"> <td><b>ID</b></td> <td><b>图书名称</b></td> <td><b>价格</b></td> <td><b>作者</b></td> </tr> <s:iterator value="list" var="book" status="st"> <s:if test="#st.even"> <tr align="center" bgcolor="#f0f0f0"> </s:if> <s:elseif test="#st.odd"> <tr align="center"> </s:elseif> <td> <s:property value="#book.id"/> </td> <td> <s:property value="#book.name"/> </td> <td> <s:property value="#book.price"/> </td> <td> <s:property value="#book.author"/> </td> </tr> </s:iterator> </table> </body>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码