JSP c:ForEach

来源:互联网 发布:网络盒子 电视直播 编辑:程序博客网 时间:2024/05/15 02:20
特性         Getter                      描述 
current    getCurrent()          当前这次迭代的(集合中的)项 
index       getIndex()               当前这次迭代从 0 开始的迭代索引 
count      getCount()             当前这次迭代从 1 开始的迭代计数 
first          isFirst()                  用来表明当前这轮迭代是否为第一次迭代的标志 
last          isLast()                  用来表明当前这轮迭代是否为最后一次迭代的标志 
begin      getBegin()             begin 属性值 
end         getEnd()                 end 属性值 

step        getStep()                step 属性值

current当前这次迭代的(集合中的)项   
index当前这次迭代从 0 开始的迭代索引 
count当前这次迭代从 1 开始的迭代计数
first用来表明当前这轮迭代是否为第一次迭代的标志
last用来表明当前这轮迭代是否为最后一次迭代的标志
begin属性值   
begin属性值   
begin属性值   
<c:forEach items="${list1}" var="obj"varStatus="stat"
${stat.index}  
.... 
</c:forEach>   

<tr>            
        <c:forEach items="${map.lstIndustryInvestment}" var="IndustryInvestment" varStatus="status" >
          <td>
       <c:choose> 
         <c:when test="${IndustryInvestment.b==null}">
                 --
         </c:when>
         <c:otherwise>         
           <c:choose>
                  <c:when test="${status.index==0}">                        
                     ${IndustryInvestment.b}
                  </c:when>
                  <c:otherwise>      
                    <fmt:formatNumber value="${IndustryInvestment.b}" pattern="#,##0.00"/>      
                  </c:otherwise>                
                </c:choose>               
              </c:otherwise>                             
            </c:choose>
          </td>    
        </c:forEach>              
      </tr>