1. 程式人生 > >關於s:iterator 和s:if 的結合使用

關於s:iterator 和s:if 的結合使用

 <s:iterator value="UserList" id="UserList">
         <tr>
          <td height="20" bgcolor="#FFFFFF">
           <div align="center">
            <span class="STYLE1"><s:property value="index" /></span>           
           </div>
          </td>
          <td height="20" bgcolor="#FFFFFF">
           <div align="center" class="STYLE1">
            <div align="center">
             <s:property value="business_name" />
            </div>
           </div>
          </td>
          <td height="20" bgcolor="#FFFFFF">
           <div align="center">
            <span class="STYLE1"><s:property value="user_name" /></span>
           </div>
          </td>
          <td height="20" bgcolor="#FFFFFF">
           <div align="center">
            <span class="STYLE1"><s:property value="user_pwd" /></span>
           </div>
          </td>
          <td bgcolor="#FFFFFF">
           <div align="center">
            <span class="STYLE1">
             <s:if test ="%{#UserList.auth == 1}">
              系統管理員
             </s:if>
             <s:if test ="%{#UserList.auth == 2}">
              商務代表
             </s:if>
            </span>
           </div>
          </td>
          <td height="20" bgcolor="#FFFFFF">
           <div align="center">
            <span class="STYLE1">
             <s:if test ="%{#UserList.is_del == 0}">
              啟用
             </s:if>
             <s:if test ="%{#UserList.is_del== 1}">
              停用
             </s:if>
            </span>
           </div>
          </td>
          <td height="20" bgcolor="#FFFFFF">
           <div align="center">
            <span class="STYLE4"><img src="tab/images/edt.gif"
              width="16" height="16" />編輯&nbsp; &nbsp;<img
              src="tab/images/del.gif" width="16" height="16" />停用</span>
           </div>
          </td>
         </tr>                                  
         </s:iterator>