struts2的if用法

<s:iterator value="#request.organ" id="item" status="st">
<tr style="background: <s:if test="#st.odd">#ccffff</s:if><s:else>#ccff99</s:else>"
  ondblclick="enterEdit('<s:property value="orgNo"/>')" onmouseover="this.style.backgroundColor='#99cc00'"
  onmouseout="<s:if test="#st.odd">this.style.backgroundColor='#ccffff'</s:if>
  <s:else>this.style.backgroundColor='#ccff99'</s:else>">
<td><div align="center"><input type="checkbox" name="checkItems" value="<s:property value="orgNo"/>"/></div></td>
<td><div align="center"><%=++num %></div></td>
<td><div align="center"><s:property value="orgNo"/> </div></td>
<td><div align="center"><s:property value="orgName"/></div></td>
<s:set name="started" value="1"/>
<td><div align="center"><s:if test="#item.started==1">启用</s:if><s:else>不启用</s:else> </div></td>
<td><div align="center"></div></td>
<td><div align="center"><s:property value="sortNo"/></div></td>
<td><div align="center"></div></td>

</tr>
</s:iterator>

猜你喜欢

转载自huweiyi.iteye.com/blog/1905214