0

我有这个迭代器的问题......它不会得到迭代器的索引,所以我可以输入一个“如果”......它直接进入其他......我想我没有得到正确索引,但我不知道如何...如果可以,请提供帮助

 <s:iterator  value="fileNames" status="idx">
   <s:set name="index" value="#idx.index"/> 
            <s:if test="%(#index)=4" >
        <div id="ngg-image-01"  class="ngg-gallery-thumbnail-box">
        <div class="ngg-gallery-thumbnail">
        <a id="1" rel="prettyPhoto[set_1]"                                                                      
                 href="${pageContext.request.contextPath}/userfiles/images/inside/7-  
                 days/prettyPhoto[set_1]/<s:property/>" alt="<s:property/>"><br />
                <img title="revederepensiune-vara-02"                                         
         src="userfiles/images/inside/7-days/prettyPhoto[set_1]/thmbs/<s:property/>" 
        alt="" width="89" height="66" /><br /></a></div>
                                </div> 
            </s:if>

              <s:else> 
                <div id="ngg-image-01" class="ngg-gallery-thumbnail-box">
        <div class="ngg-gallery-thumbnail">
        <a id="1" rel="prettyPhoto[set_1]" 
           href="${pageContext.request.contextPath}/userfiles/images/inside/7-
           days/prettyPhoto[set_1]/<s:property/>" alt="<s:property/>"><br /> 
      <img title="revederepensiune-vara-02"
     src="userfiles/images/inside/7-days/prettyPhoto[set_1]/thmbs/<s:property/>" 
     alt="" width="89" height="66" /><br /></a></div>
                                </div> 
              </s:else>              




     </s:iterator>
4

1 回答 1

1

<s:if您的标签语法错误。更改测试属性 - 括号应该是花括号,=应该是==,如下所示:

<s:if test="%{#index==4}" >
于 2012-10-03T12:41:27.263 回答