1 html中的核心**:jsp查詢結果分頁
寫在標籤中
5<%
6int allpage=1; //
總的頁碼數
7int currpage=0;//
當前頁碼數
8int startpage=1;//
起始頁碼數
9int rec=9;//
記錄總數
10int dispn=7;//
總共顯示的頁碼數
11int halfdisp=3;//
顯示頁數的一半
12int endpage=0;//
顯示的最大頁碼
1314 allpage=(int)math.ceil(rec/2.0);//
計算總的頁碼數
1516 string s=request.getparameter("page");//
初始化當前頁
17if ( s==null) else
2223
if (allpage<=dispn) else else else
38 }
39if ((startpage+dispn)<=allpage) else
44 }
45 }
4647
for(int i=startpage;i<=endpage;i++)
5051 %>
參考:jsp資料分頁例項:mysql翻頁:
jsp實現頁面分頁。
1 要實現分頁,則需要獲取3樣東西 總頁數 當前所在頁 頁面要顯示的list。2 後台資料獲取與處理 這裡的話是獲取的伺服器傳來的json資料 string page request.getparameter page if page null string pagesize request.get...
java分頁 jsp 結合實現
page contenttype text vnd.wap.wml charset utf 8 page import cn.sowap.dbclass include file inc header.jsp string sid request.getparameter sid null?requ...
jsp 簡單分頁
總記錄數 int count persondao.getcount 每頁顯示5條 int pagesize 5 當前頁 int currentpage 1 int pagecount count pagesize 1 pagesize string currentpgae request.getpa...