代碼如下
<s:iterator value="equipmentInfos" status="equipmentInfoStatus" id="equipmentInfo">
<s:if test="#equipmentInfoStatus.odd == true">
<tr bgColor="#F9F9F7">
</s:if>
<s:else>
<tr bgcolor="#FFFFFF" >
</s:else>
<s:if test="#request.hostid.equals(#equipmentInfo.equipmentid)">
<td height="20" class="STYLE1BOLD" ><s:property value="equipmentid"/></td>
<td height="20" class="STYLE1BOLD" ><s:property value="equipmentname"/></td>
<td height="20" class="STYLE1BOLD" ><s:property value="equipmenttype"/></td>
</s:if>
<s:else>
<td height="20" class="STYLE1" ><s:property value="equipmentid"/></td>
<td height="20" class="STYLE1" ><s:property value="equipmentname"/></td>
<td height="20" class="STYLE1" ><s:property value="equipmenttype"/></td>
</s:else>
</tr>
</s:iterator>
第一個是判斷奇數偶數行,沒什麼。主要是第二個。如何用request裏面的值和list裏面的值進行比較。