mysql分页功能怎么实现 mysql分页如何实现( 二 )


descriptionAn in-depth look at creating applications
with XML./description
/book
book id="bk102"
authorRalls, Kim/author
titleMidnight Rain/title
genreFantasy/genre
price5.95/price
publish_date2000-12-16/publish_date
descriptionA former architect battles corporate zombies,
an evil sorceress, and her own childhood to bee queen
of the world./description
/book
book id="bk103"
authorCorets, Eva/author
titleMaeve Ascendant/title
genreFantasy/genre
price5.95/price
publish_date2000-11-17/publish_date
descriptionAfter the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society./description
/book
book id="bk104"
authorCorets, Eva/author
titleOberon's Legacy/title
genreFantasy/genre
price5.95/price
publish_date2001-03-10/publish_date
descriptionIn post-apocalypse England, the mysterious
agent known only as Oberon helps to create a new life
for the inhabitants of London. Sequel to Maeve
Ascendant./description
/book
book id="bk105"
authorCorets, Eva/author
titleThe Sundered Grail/title
genreFantasy/genre
price5.95/price
publish_date2001-09-10/publish_date
descriptionThe o daughters of Maeve, half-sisters,
battle one another for control of England. Sequel to
Oberon's Legacy./description
/book
book id="bk106"
authorRandall, Cynthia/author
titleLover Birds/title
genreRomance/genre
price4.95/price
publish_date2000-09-02/publish_date
descriptionWhen Carla meets Paul at an ornithology
conference, tempers fly as feathers get ruffled./description
/book
book id="bk107"
authorThurman, Paula/author
titleSplish Splash/title
genreRomance/genre
price4.95/price
publish_date2000-11-02/publish_date
descriptionA deep sea diver finds true love enty
thousand leagues beneath the sea./description
/book
book id="bk108"
authorKnorr, Stefan/author
titleCreepy Crawlies/title
genreHorror/genre
price4.95/price
publish_date2000-12-06/publish_date
descriptionAn anthology of horror stories about roaches,
centipedes, scorpions and other insects./description
/book
/catalog
/xml
table id="mytable" datasrc="http://img.readke.com/231130/152350M61-0.jpg" border=1 DATAPAGESIZE="2"
theadthTitle/ththAuthor/ththGenre/ththPublish Date/ththPrice/th/thead
tbodytr
tdspan datafld="title"/span/td
tdspan datafld="author"/span/td
tdspan datafld="genre"/span/td
tdspan datafld="publish_date"/span/td
tdspan datafld="price"/span/td
/tr
/tbody
/table
input type=button value="https://www.04ip.com/post/previous page" onclick="mytable.previousPage()"
input type=button value="https://www.04ip.com/post/next page" onclick="mytable.nextPage()"
/body
/
------------------------------------
分页显示的模板程序
!--show_page.jsp--
%@ page import="javang.*" import="java.sql.*" import="java.util.*" contentType="text/;charset=GB2312"%
%@ page import="tax.*"%
jsp:useBean id="RegisterBean" class="tax.RegisterBean" scope="page"/
jsp:useBean id="itemlist" class="tax.itemlist" scope="page"/
%
int PageSize = 10;设置一页显示的记录数
int PageNum = 1; 初始化页码=1
int PageNumCount = (136+PageSize-1) / PageSize;记算总页数
计算要显示的页码
String strPageNum = request.getParameter("page");取得href提交的页码
if(strPageNum==null){ 表明在QueryString中没有page这一个参数,此时显示第一页数据
PageNum = 1;
}

推荐阅读