码迷,mamicode.com
首页 > 其他好文 > 详细

zf-分页后台代码

时间:2015-09-30 19:33:31      阅读:221      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!