Solved

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

Posted on 2008-06-23
3
1,453 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
map interface methods 3 53
Core Java. Building method that invoke another methods. 2 42
mapAB Challlenge 35 89
base64 decode encode 12 100
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now