zoukankan      html  css  js  c++  java
  • JSTL中想要实现break类似功能的实现方法!

                                            <!-- 外层循环 -->
    					<c:forEach begin="1" end="${recommend.intCount}" varStatus="state">
    						<tr>
    							<td width="20%">
    								推荐位置${state.count}:
    							</td>
    							<td width="80%">
    								<!-- 标记 -->
    								<c:set var="isDoing" value="0" />
    								<!-- 内层循环 -->
    								<c:forEach items="${recommend.recommendMediaSet}" var="recommendMedia">
    									<c:if test="${recommendMedia.intSort == state.count}">
    										<!-- 标记符合条件 -->
    										<c:set var="isDoing" value="1" />
    										<!-- 设置变量 -->
    										<c:set var="strId" value="${recommendMedia.media.strId}" />
    										<c:set var="strTitle" value="${recommendMedia.media.strTitle}" />
    									</c:if>
    								</c:forEach>
    								<!-- 判断标记 -->
    								<c:if test="${isDoing == 1}">
    									<input type="hidden" id="sortID_${state.count}_id" name="sortID_${state.count}" value="${strId}" />
    									<input type="text" id="sortID_${state.count}" name="sortID_${state.count}" readonly="readonly" value="${strTitle}" onclick="showMedias(this)" />
    								</c:if>
    								<c:if test="${isDoing == 0}">
    									<input type="hidden" id="sortID_${state.count}_id" name="sortID_${state.count}" />
    									<input type="text" id="sortID_${state.count}" name="sortID_${state.count}" readonly="readonly" onclick="showMedias(this)" />
    								</c:if>
    								<input type="button" value="清除" onclick="cleanMedia('sortID_${state.count}')" style=" auto;" />
    							</td>
    						</tr>
    					</c:forEach>
    

  • 相关阅读:
    第一个Django demo
    内建函数
    Git积累
    区间dp
    【Spring】Spring AOP详解(转载)
    【git】git 常用命令(含删除文件)
    【idea】idea如何在maven工程中引入jar包
    【Java】Scanner类nextInt后使用nextLine无法读取输入
    【Java_Eclipse】Eclipse插件如何卸载?
    【MySQL】MySQL5.7等以上版本在Windows上的配置
  • 原文地址:https://www.cnblogs.com/live365wang/p/2079729.html
Copyright © 2011-2022 走看看