JSP怎样实现分页
有几种方式
谢谢
有几种方式
谢谢
解决方案 »
- Jetty访问路径的问题
- 有关css问题
- 急问!谁使用过org.apache.commons.net.ftp.FTPClient类,如何获得给定服务器文件的信息
- java人聚集的地方
- 【字符截取问题】
- 很菜鸟的问题
- 简单问题,数据格式
- 怎么读取上传文件里面的内容啊,
- 各位大虾,我在使用resin的数据库连接池时发生了错误,请大家帮我看看怎么回事。很急!!!
- 急急...送分。。关于JSP的错误:java.lang.StringIndexOutOfBoundsException: String index
- 网站做完后,第一次加载jsp页面时速度较慢,我知道是tomcat编译jsp的缘故,问题是:怎么能将所有jsp页面一次全部编译掉?
- jsp中怎么判断COOKIE是临时cookie还是非临时cookie?
public class PageBean {
//每页显示数
public final int pageSize = 10;
//记录总数
public int totalRecord;
//总页数
public int totalPage;
//当前页
public int currentPage;
//每页开头行
public int beginRow;
//每页结束行
public int endRow;
//页的位数
public int digitPage;
public PageBean(){
currentPage = 1;
//数据库Discount表的总记录数
DiscountDaoImpl ddi = new DiscountDaoImpl();
totalRecord = ddi.getDiscountInfo().size();
totalPage = (totalRecord % pageSize == 0) ? (totalRecord / pageSize) : ((totalRecord / pageSize) + 1);
beginRow = 0;
endRow = 9;
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
if(currentPage <= 0){
currentPage = 1;
}
if(currentPage > totalPage){
currentPage = totalPage;
}
this.currentPage = currentPage;
}
public int getTotalRecord() {
return totalRecord;
}
public int getBeginRow() {
return (currentPage - 1) * pageSize;
}
public int getEndRow() {
return currentPage * pageSize - 1;
}
public int getTotalPage() {
return totalPage;
}
}