This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes Paging records Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Paging records" Watch "Paging records" New topic
Author

Paging records

Sarah Shay
Greenhorn

Joined: Jan 04, 2005
Posts: 14
Hi,

Ive been researching how to implement paging in my JSP. I can allow a user to select teh number of records they want to display and then I need to implement this functionality. I will probably need to write a custom tag to do this but Im not overly sure. Could someone help me out?

Thanks,
Sarah
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14487
    
    7

There are a number of ways to do paged table displays. Custom tags work, Struts iterators work, I've done a number of things in straight Java over the years (some of them pretty ugly ), and most recently, there's an extended data table display in the apache MyFaces project that does multipage display.


Customer surveys are for companies who didn't pay proper attention to begin with.
Sarah Shay
Greenhorn

Joined: Jan 04, 2005
Posts: 14
Hi,

So if I were to write a custom tag, how would I go about dividing my list? And displaying the particular pieces of it that I need? As in if a user hits on page 2, should I be going to my action class or should the custom tag handle it?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

Sarah, this is a subject that has been discussed many times in this forum. Take a look back and you will find topics that address this issue.

My tactic has been to have the database do the dicing and slicing of the large dataset, rather than the UI layer. After all, why send data to the front end that is just going to be ignored?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Paging records
 
Similar Threads
Please help, Urgent. !
xsl:apply-templates select= question
How to do Paging
JDBC ResultSet Paging[URGENT]
Anybody handles record paging to prevent OutOfMemoryError?