JSP iterator循环时改变样式

来源:百度知道 编辑:UC知道 时间:2024/05/31 14:55:22
Struts2框架。Actionform中有list现将该list用iterator循环输出至JSP页面
而list中的每条记录有一个属性值是判断是否为休息日 若是休息日的话该行引用样式XXX显示
该如何实现 希望能有关键代码或解决思路。小弟在这先谢谢了~~~

jsp iterator循环时一般是不会影响样式的,样式是写在table的class中的。
举例如下:
<table width="242" height="256" border="1" cellpadding="1"
cellspacing="1">
<caption>
List<List<String>>遍历如下:
</caption>
<s:iterator value="#request.listList" status="st">
<tr>
<s:iterator value="#request.listList.get(#st.index)">
<td valign="middle" align="center">
<s:property />
</td>
</s:iterator>
</tr>