摘要:1:集合不为空的情况[javascript] view plain copy   <c:if test="${not empty userRefundInfolist}">    

小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

1:集合不为空的情况

[javascript] view plain copy

   <c:if test="${not empty userRefundInfolist}">    

   <c:forEach items="${userRefundInfolist}" var="refund" varStatus="vs">    

             //循环写入知己的逻辑代码                      

  </c:forEach>    

</c:if>    

2: 集合为空的情况  

[javascript] view plain copy

   <c:if test="${empty userRefundInfolist}">    

      <img src="assets/img/weixin/无消息.png" alt="" class="img1">    

</c:if>   

3:下拉框并赋值

[javascript] view plain copy

<label class="col-sm-2 control-label">拒绝原因</label>  

                <p class="col-sm-2 control-label">  

                    <select id="rejectReason" name="rejectReason" class="form-control">  

                        <c:forEach var="one" items="${rejectReason}">  

                            <option value="${one.code}" <c:if test="${orderCheck.rejectReason == one.code}" >selected</c:if>>  

                            ${one.reason}  

                            </option>  

                        </c:forEach>  

                    </select>  

                </p>  

4:单选框并赋值

[html] view plain copy

<label class="col-sm-2 control-label">审核结果</label>  

                  <p class="col-sm-2 control-label">  

                      <input type="radio" name="state" value="3" id="agree" <c:if test="${orderCheck.state == 3}">checked</c:if> placeholder="" ><label for="agree">通过</label>  

                      <input type="radio" name="state" value="4" id="reject" <c:if test="${orderCheck.state == 4}">checked</c:if> placeholder="" 

1:集合不为空的情况

[javascript] view plain copy

   <c:if test="${not empty userRefundInfolist}">    

   <c:forEach items="${userRefundInfolist}" var="refund" varStatus="vs">    

             //循环写入知己的逻辑代码                      

  </c:forEach>    

</c:if>    

2: 集合为空的情况  

[javascript] view plain copy

   <c:if test="${empty userRefundInfolist}">    

      <img src="assets/img/weixin/无消息.png" alt="" class="img1">    

</c:if>   

3:下拉框并赋值

[javascript] view plain copy

<label class="col-sm-2 control-label">拒绝原因</label>  

                <p class="col-sm-2 control-label">  

                    <select id="rejectReason" name="rejectReason" class="form-control">  

                        <c:forEach var="one" items="${rejectReason}">  

                            <option value="${one.code}" <c:if test="${orderCheck.rejectReason == one.code}" >selected</c:if>>  

                            ${one.reason}  

                            </option>  

                        </c:forEach>  

                    </select>  

                </p>  

4:单选框并赋值

[html] view plain copy

<label class="col-sm-2 control-label">审核结果</label>  

                  <p class="col-sm-2 control-label">  

                      <input type="radio" name="state" value="3" id="agree" <c:if test="${orderCheck.state == 3}">checked</c:if> placeholder="" ><label for="agree">通过</label>  

                      <input type="radio" name="state" value="4" id="reject" <c:if test="${orderCheck.state == 4}">checked</c:if> placeholder="" 

觉得可用,就经常来吧!Javascript技巧 脚本宝典 欢迎评论哦! js技巧,巧夺天工,精雕玉琢。小宝典献丑了!

本文固定链接:

js实例教程-jstl的常用标签分享

http://www.js-code.com/js/js_1258.html

80%的人都看过