首先,在页面引入标签[color=red]
<!--taglib prefix="s" uri="/struts-tags"-->[/color] 迭代标签如下:
<s:iterator value="#request.bookList" id="book" status="st">
<tr <s:if test="#st.odd">style="background-color:#bbbbbb"</s:if>>
<td><s:property value="bookname" /></td>
<td><s:property value="author" /></td>
<td><s:property value="loadtime" /></td>
<td><s:property value="publish" /></td>
<td><s:property value="status" /></td>
<td><a href="lend.action?id=<s:property value='id'/>">借书</a></td>
</tr>
</s:iterator>