struts2 问题表单验证(分页)
在做分页时,点击上一页和下一页都正常,但是不能点击第几页的按钮时(点按钮无任何反应,无数据显示,)用Debugc测试显示 无数据传进来。。后台异常如下:
Error setting expression 'page' with value '[Ljava.lang.String;@1bd7d0e'
ognl.MethodFailedException: Method "setPage" failed for object org.liang.netctoss.action.account.AccountSearchAction@15f6479 [java.lang.NoSuchMethodException: org.liang.netctoss.action.account.AccountSearchAction.setPage([Ljava.lang.String;)]
page 的 set get 方法全写了
-----jsp代码如下:
<s:debug></s:debug>
<a href="javascript:;" onclick="goPageAction(1)">首页</a>
<s:if test="page>1">
<a href="#" onclick="goPageAction(${page-1})">上一页</a>
</s:if>
<s:else>
<a>上一页</a>
</s:else>
<s:iterator value="new int[maxPage]" status="i">
<s:if test="#i.count==page">
<a href="accountSearch.action?page=<s:property value='#{i.count}'/>" class="current_page">
<s:property value="#i.count"/>
</a>
</s:if>
<s:else>
<a href="accountSearch.action?page=<s:property value='#{i.count}'/>"><s:property value="#i.count"/></a>
</s:else>
</s:iterator>
<s:if test="page<maxPage">
<a href="#" onclick="goPageAction(${page+1})">下一页</a>
</s:if>
<s:else>
<a>下一页</a>
</s:else>
<s:if test="page=maxPage">
<a href="javascript:;" onclick="goPageAction(${maxPage})">末页</a>
</s:if>
</div>
Struts 分页 异常 --------------------编程问答-------------------- 提示说你没有定义setPage方法,你确定有这个方法?有时候只是拼写错误的问题, --------------------编程问答-------------------- setPage方法参数是string类型的吗?
补充:Java , Web 开发