tags:

views:

45

answers:

3

in my application the jsp is calling the method to fetch records from database.the method returns an array and using for loop the array values are displayed using jsp technology in the html page. if suppose the array length is 100 then 100 records are displayed on the same page.i want that 20 records should be displayed on the page and using a link next 20 later then next 20 and so on.

please suggest probable methods to do this. thanx in advance

+2  A: 
  • use displaytag
  • google for "jsp pagination" and "jsp paging"
Bozho
A: 

using displaytag would be great. You can set the number of records for a page. You can even activate sortable option for columns so that a user can sort according to his needs.

Richie
A: 

Displaytag is popular, but not memory efficient. If the rowcount gets high, rather do the paging at database level. I've posted similar answer before here, complete with code snippets: http://stackoverflow.com/questions/1986998/resultset-to-pagination

BalusC