首页 > 其他 > 详细

zf-分页后台代码

时间:2015-09-30 19:31:16      阅读:249      评论:0      收藏:0      [点我收藏+]

java :

public ResultPage getDeptList(int page, int pageRows) throws Exception {
        String hql="from ZfoaOrgan a where upper(a.isxzfw)=‘Y‘ and a.orgFlag=0 and a.orgLayer=1  Order by a.orgId";
        return getResultPage(hql, new Object[]{}, page, pageRows);
    }

接口必须是ResultPage返回值

    ResultPage tmp = consultationService.getDeptList(getPage(),
                getPageRows());
          setMaxPage(tmp.getMaxPage());  // 必写
          deptList = tmp.getResultList(); // 必写

创建个 ResultPage tmp; 变量 然后调用上面的ResultPage返回值的接口

 setMaxPage(tmp.getMaxPage());  //必写的
   deptList = tmp.getResultList(); // 必写的

如果分页的20行,但是只显示4行,那么一定是jsp代码的问题,有可能是有2个table.

jsp
<div class="quotes">
<span class="disabled"> < </span>
<%@include file="../include/pagination.inc" %>
</div>

写在跟table一个 div里 但是要写在table外面。

 
 

zf-分页后台代码

原文:http://www.cnblogs.com/YangK-java/p/4849840.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!