先上代码type的长度是2,,attr的属性是4:
其中type的id=1的有三条属性
type=2有一条属性
<c:forEach items="${typeList}" var="type" varStatus="index"><tr><th width="15%">分类信息</th><th>${type.typename }<input type="hidden" name="type${index.index }" value="${type.id }"/></th></tr><c:if test="${fn:length(addAttrList)==0}"><c:forEach items="${attrList}" var="attr" varStatus="seq"><c:if test="${type.id == attr.type}"><tr><td>${attr.name }<input type="hidden" name="attr${index.index }${seq.index }" value="${attr.id }"/><input type="hidden" name="name${index.index }${seq.index }" value="${attr.name }"/></td><td><input type="text" id="value${index.index }${seq.index }" name="value${index.index }${seq.index }" value="" class="required" title="请输入属性值"/></td></tr></c:if></c:forEach></c:if>很简单的循环套一个循环,为什么是13而不是10????
那就是说seq在第二次循环开始的时候不是从0开始???
我去,这太逆天了!!跟平时用的for循环差这么多???坑
好吧,今天涨姿势了!!!!!!!!!!
版权声明:本文为博主原创文章,未经博主允许不得转载。
才会看到属于自己的那一片晴朗的天空。