问答详情
源自:4-1 SSH-案例:分页查询员工

为什么员工界面按下一页没反应,部门界面就ok,谁帮我看看

<struts>

     <package name="ssh" namespace="/" extends="struts-default">

     <action name="employee_*" class="employeeAction" method="{1}" >

     <result name="input">/index.jsp</result>

     <result name="success" type="redirect">/frame.jsp</result>

     <result name="findAll">/frame/listEmployee.jsp</result>

     </action>

public String findAll(){

PageBean<Employee> pageBean = employeeService.findByPage(currentPage);

ActionContext.getContext().getValueStack().push(pageBean);

    return "findAll";

    }

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

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

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

   </s:if>

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

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

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

    </s:if>


提问者:billturing 2017-07-30 17:25

个回答

  • 慕码人7551790
    2019-11-14 23:05:02

    员工的action中,你的currPage要提供set方法

  • weup
    2018-04-18 21:26:24

    呃呃呃,我也不知道,,,