开发者

Displaying limited number of records in jsp

开发者 https://www.devze.com 2022-12-19 09:32 出处:网络
Ii have a txt file which contains 2000 rows of data. I want to retrive this data and dispaly in a table form, but i want show some 20-30 records per page and rest 开发者_开发知识库numbering the pages

Ii have a txt file which contains 2000 rows of data. I want to retrive this data and dispaly in a table form, but i want show some 20-30 records per page and rest 开发者_开发知识库numbering the pages like in google.

How do you achieve this in jsp.


After reading the article linked by Jon, you can use Displaytag which has built-int paging functionality


You need to look into pagination using JSP, there's a tutorial that I found from this great search engine called Google:

http://www.javaworld.com/javaworld/jw-07-2004/jw-0726-pagination.html

It will talk you through the process.


This question is asked a few several times before here. Just checkout under each the tags pagination + jsp. I've answered this topic: ResultSet to Pagination. You may find it useful as well.

DisplayTag is another alternative, but it is not memory efficient as it caches all the rows in Java's memory, which might blow if you have thousands of rows and/or thousands of concurrent users. In such case better go ahead with DAO/database-level pagination, as outlined in my answer in the linked topic.

0

精彩评论

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

关注公众号