Solved

How to do Pagination with out using display tag api and java script

Posted on 2008-06-23
3
1,474 Views
Last Modified: 2013-11-24
I am doing pagination . every time i want to display 15 records on the page. And when i will click on next button i want to retreive next 15 records and on clicking previous should come to previous results.

Is there any good example code to implement this pagination technique without display tag and jaav script.
only using server side code (java code)
0
Comment
Question by:Shakil_Akhtar
  • 2
3 Comments
 
LVL 13

Expert Comment

by:MicheleMarcon
ID: 21852900

String records[];//already initialized
int recordsPerPage=30;//for example
 
view (int page)
{
for (int i=page*recordsPerPage;i<(page+1)*recordsPerPage;i++)
System.out.println(records[i]);
}

Open in new window

0
 

Author Comment

by:Shakil_Akhtar
ID: 21852951
This will happen if we already  have all matching data from data base. But in my case i have a web service that is returning 16 records at a time with matching data. If matching data is 30 then first time it will give 16 and i will enable next button for getting remaining items.
So how to handle this either from screen side or from hibernate implementation(i.e from DB side).
I have written hibernate because my web service is developed using hibernate.

Please give an elavorated example to understand complete functionality.
Thanks,
0
 
LVL 13

Accepted Solution

by:
MicheleMarcon earned 500 total points
ID: 21853302
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTTPSessionBindingListernter not configured in deployment descriptor 2 65
login jsp example 24 62
Eclipse with gitlab 1 77
hashmap order 17 36
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question