当前位置: 代码迷 >> Java Web开发 >> s:iterator有关问题
  详细解决方案

s:iterator有关问题

热度:8281   发布时间:2016-04-10 23:40:23.0
s:iterator问题
<s:set var = "pagenum" value = "#articles.length%5==0 ? #articles.length/5 : #articles.length/5+1" />
                                <s:property value = "#pagenum"  />                             
                            </li>
                         
             
                    <s:iterator value = "#pagenum" id = "currentpage" status = "xyz">
                             
                             
                            <li class="active_page">   
                                <a href="javascript:void(0);">1</a>
                            </li>
                            <li>
                                <a href="javascript:void(0);">2</a>
                            </li>
                            <li>
                                <a href="javascript:void(0);">3</a>
                            </li>
                            <li>
                                <a href="javascript:void(0);">4</a>
                            </li>
                            <li>
                                <a href="javascript:void(0);">5</a>
                            </li>
                    </s:iterator>

#pagenum这个值是2 但是iterator标签内的内容 那一些个链接只打印了一次
不是应该打印两次的吗? 

------解决方案--------------------
<s:iterator value
这里的value是一个数组,你传一个2过来啥意思?

<s:iterator var="counter" begin="1" end="5" >
   <!-- current iteration value (1, ... 5) -->
   <s:property value="top" />
</s:iterator>
  相关解决方案