开发者

how to display query result in multiple pages

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 i开发者_开发问答n advance


  • use displaytag
  • google for "jsp pagination" and "jsp paging"


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: ResultSet to Pagination


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜