struts2 的s:if用法1-与request中的对象比较值

做了一个界面,大体的需求是:从主画面传进一个ID,这个画面上是所有ID的列表,但是对于传进来的那条ID对应的记录,全红显示。这样在s:iterator的时候用了一下s:if
代码如下

<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里面的值进行比较。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值