JSP_网上搜集的分页及example搜索相关代码(8)
发布时间:2021-06-07
发布时间:2021-06-07
前页
BookPaginQuery bookPaginQuery = new BookPaginQuery();//实例化 bookPaginQuery.setCountRow(); //设置总行数
bookPaginQuery.setCountPage(); //设置总页数
int countPage = bookPaginQuery.getCountPage(); //获得总页数
//如果当前页数小于 0 或大于总页数,则把当前页重新设为 1 ,即首页 if (pageNum<=0 || pageNum>countPage){ }
bookPaginQuery.setCurrentlyPage(pageNum); //设置当前页
int currentlyPage = bookPaginQuery.getCurrentlyPage(); //获得当
List<Book> bookList = bookPaginQuery.myBookPaginQuery(pageNum);
pageNum = 1;
BookPaginQuery 类,得到 bookPaginQuery 对象
//分页查询 %> <% %>
<tr>
<td width="200"><%=book.getBook_name() %></td> <td width="100"><%=book.getBook_num() %></td> <td width="50"><%=book.getBook_author() %></td> <td width="50"><%=book.getBook_price() %></td> <td width="300"><%=book.getBook_synopsis() %></td> <td
for (int i=0; i<bookList.size(); i++) {
Book book = bookList.get(i);
<table border="1" align="center"> <tr>
<th align="center">图书名称</th> <th align="center">图书编号</th> <th align="center">作者</th> <th align="center">价格</th> <th align="center">图书简介</th> <th align="center">出版日期</th>
</tr>
if(bookList!=null && bookList.size()>0) {
width="100"><%=book.getBook_publishTime().substring(0,10) %></td>
</tr>
上一篇:独放的生命