I had 4000+ records. I already worked on a kind of pagination where for every page number, request hits the database. I want to
modify the design .
First i want store 300 records in arraylist from database. i will show 25 records for each page number. so for each page click, request will not hit the database. It fetches records from arraylist. If arraylist get scarce of records then another 300 records should be fetched and then displayed.
Any one having ideas or suggestions, Please share....:)
I used scriptlets in my jsp code. Please ignore it. Anyway i will change the code. I am more concentrating on the pagination . If pagination get succeed then i will change the scriptlet code.
For the first time list is iterating fine. after first 300 records pagination , i will fetch next 300 records from database. fetched records iam storing them in arraylist from index 0 to 299. I am calculating fromIndex and toIndex (i.e. sublist for pagination) based on pageNumber. based on page number fromIndex and toIndex values are some 290 to 318. But in the arraylist index is from 0 to 300.
This clearly states that my design is missing something. Please correct this and share your ideas to generalize it.