public class PageBean<T> {
//当前第几页
private int pc;
//共有多少条记录
private int tr;
//每页记录数
private int ps;
//请求路径和参数
private String url;
//当前页的List
private List<T> beanList;
// 计算总页数
public int getTp() {
int tp =(int) tr / ps;
if(tp = tr % ps != 0)
{
tp++;
}
return tp;
}
public int getPc() {
return pc;
}
public void setPc(int pc) {
this.pc = pc;
}
public int getTr() {
return tr;
}
public void setTr(int tr) {
this.tr = tr;
}
public int getPs() {
return ps;
}
public void setPs(int ps) {
this.ps = ps;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<T> getBeanList() {
return beanList;
}
public void setBeanList(List<T> beanList) {
this.beanList = beanList;
}
}
java web分页bean
最新推荐文章于 2019-04-20 14:37:47 发布