struts2 、mybatis 、easyui 分页
2016-08-06 07:28
190 查看
rows
page
控件自动提交这两个参数
pageSize number The page size. 10
pageNumber number Show the page number when pagination is created. 1
pageList array User can change the page size. The pageList property defines how many size can be changed. [10,20,50,100]
action
serviceImpl
page
控件自动提交这两个参数
pageSize number The page size. 10
pageNumber number Show the page number when pagination is created. 1
pageList array User can change the page size. The pageList property defines how many size can be changed. [10,20,50,100]
action
/** * easyui获取APP信息 * */ public String getAppList() { dataMap = appService.getApp(rows, page); return "json"; } public String getRows() { return rows; } public void setRows(String rows) { this.rows = rows; } public String getPage() { return page; } public void setPage(String page) { this.page = page; } public Map<String, Object> getDataMap() { return dataMap; } public void setDataMap(Map<String, Object> dataMap) { this.dataMap = dataMap; }
serviceImpl
public Map<String, Object> getApp(String rows, String page) { // 分页信息 int pageNo = Integer.parseInt((page == null || page == "0") ? "1" : page); int pageSize = Integer.parseInt((rows == null || rows == "0") ? "10" : rows); Map<String, Object> dataMap = new HashMap<String, Object>(); dataMap.put("total",appMapper.countByExample(null)); dataMap.put("rows", appMapper.selectByExample( null, new RowBounds((pageNo - 1) * pageSize,pageSize))); //org.apache.ibatis.session.RowBounds.RowBounds(int offset, int limit) return dataMap; }
相关文章推荐
- Spring+SpringMVC+MyBatis+EasyUI实现CRUD与分页
- Mybatis学习(4):Mybatis及PageHelper插件和easyUI实现分页
- Spring+SpringMVC+mybatis+easyui整合实例----使用mybatis拦截器分页
- springmvc mybatis 分页 控制层及sql语句 oracle mysql easyui
- design项目:2、mybatis + easyui datagrid 分页查询功能介绍
- Struts2 + easyui的DataGrid 分页
- mybatis+easyUI实现分页
- EasyUI datagrid+SpringMVC+MyBatis实现分页查询
- easyui的datagrid整合struts2,以及Ajax,实现局部刷新功能,并设置分页的实现---------投票案例
- spring+spring mvc+mybatis+mysql+easyui实现的分页
- easyui 分页 + mybatis 分页插件 PageHelper 完成分页显示功能(SpringMVC + mybatis 框架)
- Struts2 + easyui的DataGrid 分页
- mybatis+easyui分页
- SpringMVC+MyBatis+EasyUI 实现分页查询
- 【MyBatis】MyBatis+SpringMVC+EasyUI整合分页
- easyui+spring MVC+Mybatis实现分页查询
- Java主流几大框架的对比(EasyUI,Bootstrap,Struts2,SpingMvc,Ejb,Spring,Hibernate,Mybatis)
- Spring+SpringMVC+mybatis+easyui整合实例(五)使用mybatis拦截器分页
- MyBatis+springMVC+easyUI (dataGirl)实现分页
- SSM+easyUI结合Mybatis-PageHelper实现分页功能