日期:2014-05-17  浏览次数:20731 次

struts 标签使用
<s:iterator begin="0" end="%{pagebean.totalPage-1}" status="status">
<s:if test="%{pagebean.currentPage < status.index+2}">
<a> 
${status.index+1}
</a>


大侠们如何才能让 <s:if test 比较通过这样就是不行
------解决方案--------------------
试试<s:if test="%{#pagebean.currentPage < status.index+2}">
------解决方案--------------------
楼主的pageBean在值栈里有了吗,还有struts2标签本身就支持ognl了不需要用%{}包起来
------解决方案--------------------
pagebean对象在ActionContext还是对象栈里?你先看在页面能不能打印出来%{pagebean.totalPage-1}的值。
建议你直接用EL${ } 这个来取,不要用%{ }.
你if里面的这一句改成这个试一试:${pagebean.currentPage < #status.index+2}