问答详情
源自:3-2 SSH-案例:分页查询部门

点击下一页没有数据,显示No result defined for action com.lzy.employ.action.DepartmentAction and result input

这是控制台的报错:

WARN com.opensymphony.xwork2.ognl.OgnlValueStack:64 - Error setting expression 'currPage' with value '[Ljava.lang.String;@7b067fd7'

ognl.MethodFailedException: Method "setCurrPage" failed for object com.lzy.employ.action.DepartmentAction@5f675cef [java.lang.NoSuchMethodException: com.lzy.employ.action.DepartmentAction.setCurrPage([Ljava.lang.String;)]


提问者:抬头就是阳光c 2017-03-31 10:35

个回答

  • 抬头就是阳光c
    2017-03-31 15:55:39

    错误就在上面我那段代码中,已经找出来了,就是多加个符号,如果有人跟我一样报错就在这里回我,我都不好意思贴出那个错误,浪费我至少4到5小时,真的蓝瘦香菇。但是又有个问题,上面的报错真的说的一点都不明确,根本就不会想到是这里的问题。。。


  • 抬头就是阳光c
    2017-03-31 14:26:28

     No result defined for action com.lzy.employ.action.DepartmentAction and result input,现在点击下一页总是会出现这个错误界面

  • 抬头就是阳光c
    2017-03-31 11:07:56

    现在变成点击下一页,就闪一下,什么错都没报,下面是jsp代码

    <td align="right">

       <span>第<s:property value="currPage"/>/<s:property value="totalPage"/>页</span>&nbsp;&nbsp;

       <span>总记录数:<s:property value="totalCount"/>&nbsp;&nbsp;每页显示:<s:property value="pageSize"/></span>&nbsp;&nbsp;

       <span>

       <s:if test="currPage != 1">

           <a href="${pageContext.request.contextPath}/department_findAll.action? currPage=1 }">[首页]</a>&nbsp;&nbsp;

           <a href="${pageContext.request.contextPath}/department_findAll.action? currPage=<s:property value="currPage-1"/> }">[上一页]</a>&nbsp;&nbsp;

        </s:if>

        <s:if test="currPage != totalPage">

           <a href="${pageContext.request.contextPath}/department_findAll.action? currPage=<s:property value="currPage+1"/> }">[下一页]</a>&nbsp;&nbsp;

           <a href="${pageContext.request.contextPath}/department_findAll.action? currPage=<s:property value="totalPage"/> }">[尾页]</a>&nbsp;&nbsp;

        </s:if>

       </span>

    </td>