GeeCON Prague 2014*
The moose likes JSP and the fly likes regarding pagination Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "regarding pagination" Watch "regarding pagination" New topic
Author

regarding pagination

biswajit ray
Ranch Hand

Joined: Nov 30, 2005
Posts: 30
hi all,
is there anybody who can tell me what is pagination? all i want an example of pagination along with source code.
biswajit
Bimal Patel
Ranch Hand

Joined: Aug 29, 2003
Posts: 130
Hi,

In simple terms, pagination is a concept of separating no. of records/rows into pages. Every page has equal or less then allowed rows. Like you have around 100 rows to be displayed, its better to break down that into no. of pages rather to display on a single page. The best example would be Java Ranch forum where the threads are paginated.


Work Hard, Expect The Worst...<br /> <br />Bimal R. Patel<br />(SCJP 1.2, SCWCD 1.4)
sushma sree
Greenhorn

Joined: Mar 27, 2006
Posts: 12
Have a look at the display tag. you can have a collection with all the data that you need to display and use this collection with the dsiplay tag and you can get all thge possible features like sorting the columns,applying styles and what not.

http://displaytag.sourceforge.net
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
Say that you want to display 100 products on your JSP. Displaying the whole 100 items in one page is not a good idea. So you divide those 100 records into 5 page actions with next and previous button. You read all the 100 records from the database and store them in a Java Collection, and show 25 items at a time on your JSP based on some use action.

Google for "JSP pagination" and you will get a number of articles.


java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: regarding pagination