做了一个界面,大体的需求是:从主画面传进一个ID,这个画面上是所有ID的列表,但是对于传进来的那条ID对应的记录,全红显示。这样在s:iterator的时候用了一下s:if
代码如下
第一个是判断奇数偶数行,没什么。主要是第二个。如何用request里面的值和list里面的值进行比较。
代码如下
<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里面的值进行比较。