Hai guys,
i want to implement a paging(next,first,last links) functionality in my JSP (which can control displaying 1000's of records to show in order of 10 or 15 in a page and next in other page). whatz the best technique i can use.
plz help me.
regards,
Mahesh
Discussions
Web tier: servlets, JSP, Web frameworks: need paging functionality (first/next,last etc)
-
need paging functionality (first/next,last etc) (5 messages)
- Posted by: Mahesh P
- Posted on: December 29 2004 23:16 EST
Threaded Messages (5)
- need paging functionality (first/next,last etc) by Sachin Sharma on December 30 2004 02:21 EST
- RE: need paging functionality (first/next,last etc) by Prasad Javdekar on December 30 2004 04:39 EST
- need paging functionality (first/next,last etc) by damian frach on December 31 2004 08:30 EST
- ValueList by Matthew Wilson on January 04 2005 09:00 EST
- need paging functionality (first/next,last etc) by Dmitry Namiot on January 09 2005 13:17 EST
-
need paging functionality (first/next,last etc)[ Go to top ]
- Posted by: Sachin Sharma
- Posted on: December 30 2004 02:21 EST
- in response to Mahesh P
Hai guys,i want to implement a paging(next,first,last links) functionality in my JSP (which can control displaying 1000's of records to show in order of 10 or 15 in a page and next in other page). whatz the best technique i can use.plz help me.regards,Mahesh
Hi Mahesh,
Assuming that you are using Oracle, one of the ways to do paging is to:
first: figure out the total number of records that need to be displayed:
"total_records = select count(column_name) from table"
second: figure out number of records to be displayed on one page
"lets say: records_per_page = 15"
third: calculate the total number of pages
"total_number_of_pages = total_records/records_per_page"
fourth: display the records by using the "rownum" feature supported by oracle.
"select column_name from table where rownum between x and y"
hope that helps....
Sachin -
RE: need paging functionality (first/next,last etc)[ Go to top ]
- Posted by: Prasad Javdekar
- Posted on: December 30 2004 04:39 EST
- in response to Mahesh P
Hi Mahesh,
You may try out a very nice and neat custom tag library viz. "displayTag" which you will find at:
http://www.displaytag.org/index.jsp
Just look at the documentation/examples, maybe that's what you were looking for!! You will additionally get Export to Excel/XML/CSV, sorting, grouping functionalities, too.
-Prasad -
need paging functionality (first/next,last etc)[ Go to top ]
- Posted by: damian frach
- Posted on: December 31 2004 08:30 EST
- in response to Mahesh P
I am using JSF and SUN's JAVA Creator and it is quite easy:
- connect the dadaTable with your collection of beans
- add the paging
about 5 clicks of mouse
if you have collection of entity beans than the "add, update, delete" is also very quick to implement
but it is OK only for small amount of data; for bigger tables I implement the DAO by JDBC; then it requires little bit more coding ... -
ValueList[ Go to top ]
- Posted by: Matthew Wilson
- Posted on: January 04 2005 09:00 EST
- in response to Mahesh P
valuelist.sf.net -
need paging functionality (first/next,last etc)[ Go to top ]
- Posted by: Dmitry Namiot
- Posted on: January 09 2005 13:17 EST
- in response to Mahesh P
See for example Page taglib in Coldtags suite:
http://www.servletsuite.com/jsp.htm