freemarker自定义分页标签宏
用法:
<#include "/common/pager.html">
<@pager pager=param baseUrl="${basePath}/admin/pageList" parameterMap=parameterMap />
<@pager pager=param baseUrl="${basePath}/admin/pageList" parameterMap=parameterMap />
需要业务对象继承下面的实体:
public class Pager { /** * 当前页码 */ private int pageIndex = 1; /** * 每页显示多少个 */ private int pageSize = 10; /** * 多少页 */ private int totalPage; public int getPageIndex() { return pageIndex; } public void setPageIndex(int pageIndex) { this.pageIndex = pageIndex; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public int getTotalPage() { return totalPage; } public void setTotalPage(int totalPage) { this.totalPage = totalPage; } }
查询调用方式:
4. 查询调用方式 ExampleQueryBean exampleQueryBean = new ExampleQueryBean(); exampleQueryBean.setTotalPage(2); exampleQueryBean.setPageIndex(2); exampleQueryBean.setPageSize(10); model.addAttribute("param", exampleQueryBean); Map<String,String> parameterMap = new HashMap<String,String>(); parameterMap.put("supplierId", "100"); parameterMap.put("supplierName", "丽都饭店"); model.addAttribute("parameterMap", parameterMap);
相关推荐
80183053 2013-09-12
pigsmall 2020-11-19
graseed 2020-10-28
大数据杂谈 2020-09-26
SXIAOYI 2020-09-16
jinhao 2020-09-07
ChinaWin 2020-08-13
mohanzb 2020-08-01
王国平 2020-06-20
yoohsummer 2020-06-01
kangtingting0 2020-05-20
MichelinMessi 2020-02-19
impress 2020-02-20
nicepainkiller 2020-01-25
hfszy0 2013-05-15
lizhenmxcz 2013-05-12
gxyblue 2013-05-11
chenshuixian 2013-06-01
羽化大刀Chrome 2013-05-31