This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes quick paging calculation question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "quick paging calculation question" Watch "quick paging calculation question" New topic

quick paging calculation question

John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
I am using the below to calculate my page links, using LIMIT in the DB portion.

The total count is 127. This should generate 7 pages but it is only generatong 6 because the division is calculation 6.35. How would i push it to generate the 7th page?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60748

The modulo operator can be used to determine if there is a remainder after division.

P.S. Re-evaluate your HTML usage. The <font> tag is long deprecated in favor of CSS.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
lol yea they was left from an old example i was using from my previous paging tags that i am replacing with this code
[ November 24, 2008: Message edited by: John Schretz ]
John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
Ok, Here is my solution. How does this look?

It is sorta covered in the JavaRanch Style Guide.
subject: quick paging calculation question
Similar Threads
JSTL paging problem
Problem with nested c:forEach
problem incrementing loop in jstl
JSTL paging error
Problems with paging i created