Javaweb Note -03 (BS and pagination of business processes)

Source: Internet
Author: User

DAO Section: Middle tier
Declare the variable Pagerbook pagedata sumrow sumpage
Find the total number of records ID uniquely identified: SELECT COUNT (ID) as rowsum from book;
Find out the total number of pages;
Determine the total number of pages is 0 o'clock
Find the record data of the current page pagedata (flag= (Current page-1) * Number of records)
Select Top "+flag+" from book where ID not in (select Top "+flag+" ID from book)
+++++ NOTE: Because the ID is used to filter, so the record behind is the column with the ID to filter ————— ID (here)

Servlet section: Server-side
To determine if a string or a negative number is assigned to a nowpage in a URL: To make a judgment, handle the exception
The exception that appears is the data format

JSP part: Browser side

Get the Pagerbook object (pager<book>) and then, under the original table, make a decision to add a hyperlink
Parameters passed to the Booklist page booklist?nowpage=<%=%> home > 1; previous page, home < Total page, next page

Javaweb Note -03 (BS and pagination of business processes)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.