jstl的常用标签分享
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=""