开发者

Dynamic pagination in JSP

I have a jsp page that has pagination links below to call page by page data from the database.. The links look like this

<< Previous 1 2 3 4 5 6 7 8 9 10 11 Next >>

< a href="getnext.jsp?min=<%=val2%>&max=<%=val1%>>  <%=i%>  </a>  (for link 1)

(where (min=0, max=10) and i = 1 ..The rownum and page index respectively )

The challenge is that this page can have up to 2400 links/pages and i do 开发者_运维技巧not wish to create all those links at once. A better implementation would be When the next button is click I want to dynamically create the next set of links say 12 to 20.

Any ideas on how to go about doing this? Thanks


Take a look at DisplayTag. It will set everything up for you, and is highly configurable. A particularly nice feature is that it gives you the option to let it handle slicing up your results, or for you to do it for better performance with large data sets; see the page on external paging and sorting.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜