zoukankan      html  css  js  c++  java
  • JSTL标签API(c)的使用

    后台传数List,在jsp接收以${group.code }
    List<Staff> groups = staffService.getStaffsByName("", "",ZD,"G", 0, 1000);
    model.addAttribute("groups", groups);


    List<StaffRight> rights = staffRightService.getStaffRights();
    model.addAttribute("rights", rights);

    ******************************************************************************
    <td class="content" colspan="3">
    <div class="area" style="position:relative;">
    <c:if test="${!empty groups }">
    <dl>
    <c:forEach items="${groups }" var="group">
    <dd>
    <input type="checkbox" value="${group.code }" id="${group.code }" name="staff_code" />
    <label for="${group.code }">${group.code }-${group.name1 }</label>
    </dd>
    </c:forEach>
    </dl>
    </c:if>
    </div>
    </td>

    //升級:2個對象,的某一元素相等  

    <div id="div1" name="div1" class="area" style="position:relative;">
    <c:if test="${!empty outlets}">
    <dl>
    <c:forEach items="${outlets}" var="outlet">
    <c:set var="has" value="0" ></c:set>
    <dd>
    <c:if test="${!empty pays}">
    <c:forEach items="${pays}" var="pay">
    <c:if test="${pay.outlet==outlet.outlet}">
    <c:set var="has" value="1"></c:set>
    </c:if>
    </c:forEach>
    </c:if>
    <input type="checkbox" value="${outlet.outlet }" id="${outlet.outlet }" name="outlet" <c:if test="${has==1}">checked="checked"</c:if> />
    <label for="${outlet.outlet }">${outlet.outlet }-${outlet.desc1 }</label>
    </dd>
    </c:forEach>
    </dl>
    </c:if>
    </div>

    //標籤中如果有空格符,有時候也會影響代碼。代碼要規範,不能有多於的空格
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


    <td class="content" colspan="3">

    <c:if test="${!empty rights }">
    <ul>
    <c:forEach items="${ rights }" var="right">
    <li>
    ${right.desc }:
    <c:choose>
    <c:when test="${right.type=='0' }">
    <input type="radio" value="1" id="can${right.code }" name="${right.code }" />
    <label for="can${right.code }">能</label>
    <input type="radio" value="0" id="cannot${right.code }" name="${right.code }" checked />
    <label for="cannot${right.code }">不能</label>
    </c:when>
    <c:when test="${right.type=='1' }">
    <select name="${ right.code }">
    <c:forEach begin="0" end="9" step="1" var="grade">
    <option value="${ grade }">${ grade }</option>
    </c:forEach>

    </select>
    </c:when>
    <c:otherwise>
    <input type="text" name="${ right.code }" value="0" style="text-align:right; 50px;" />
    </c:otherwise>
    </c:choose>
    </<li>
    </c:forEach>
    </ul>
    </c:if>
    </td>

    <c:if test="${!empty DSCP }">
    <c:forEach items="${DSCP}" var="DSCP">
    <c:forEach items="${cats}" var="cats">
    <c:if test="${DSCP.DOpen=='TRUE' && cats.catCode==DSCP.detail}">
    <option value="${DSCP}">大大類折扣:${DSCP.DValue}%,设为最高上限,${DSCP.detail}-${cats.desc1}</option>
    </c:if>
    <c:if test="${DSCP.DOpen=='FALSE' && cats.catCode==DSCP.detail}">
    <option value="${DSCP}">大大類折扣:${DSCP.DValue}%,${DSCP.detail}-${cats.desc1}</option>
    </c:if>
    </c:forEach>
    </c:forEach>
    </c:if>

  • 相关阅读:
    在ASP.NET中把数据POST到其他页面
    在网页中使用javascript打开没有最大化、最小化和关闭按钮的窗口
    怎么找回被删并清空了回收站的文件
    域控制器的安装步骤二——把客户机加入到域
    升级和卸载域AD:实现域网络管理二
    不用设置BIOS,也能让光驱启动电脑!
    老版(旧版)封神榜片头,片尾曲
    域控制器的安装步骤一
    SEO面试试题
    如何将客户机添加到域?
  • 原文地址:https://www.cnblogs.com/OP-RONG/p/4193337.html
Copyright © 2011-2022 走看看