File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to do the pagination? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to do the pagination?" Watch "How to do the pagination?" New topic

How to do the pagination?

ramya smitha

Joined: Nov 24, 2004
Posts: 1

I have a problem with the pagination. i am getting the data to the JSP through the response from the servlet. Can anyone please help me how to do the pagination? i have thousands of records and i have to show only 14 records per page.

Thanks and Regards,
haitham raik

Joined: Aug 08, 2004
Posts: 17
to solve the pagination problem you may use a request parameter for page number(e.g., pageNo).
when the user enter the URL to visit the page for the first time. the page number parameter will be not exist so you will send the first 14 records. if the user clicked on the next button send the ?pageNo=1 Parameter with the request URL. if you received the pageNo=1 as a parameter you will send the 2nd 14 records.

Haitham Raik<br />SCJP 1.4 SCWCD 1.4 SCBCD 1.3 SCJA 1.0
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Here are some notes I took on prior discussions ... see if any of them look helpful or inspire other ideas ...

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: How to do the pagination?
It's not a secret anymore!