wood burning stoves 2.0*
The moose likes JSP and the fly likes Pagination in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Pagination in JSP" Watch "Pagination in JSP" New topic
Author

Pagination in JSP

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
Hi,

I need to implement pagination in my JSP. One way I know is, fetching data from DB in chunks. But i do not want to go for it. I am fetching entire data matching with the search provided and putting some more iteration.
After iterating on that list, i want to show them in pages.

Please let mw know the resolution for it. I am using simple JSP..no Display tags, Struts, etc.

Thanks,
Grishma
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Originally posted by Grishma Dube:
One way I know is, fetching data from DB in chunks. But i do not want to go for it.
Why not? It's the best way to do it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
It is because, i want to fetch entire list and then iterate it to check entitlements.

And display only those records which user is allowed to view. This is an patch, which we want to add.

Thanks,
Grishma
[ March 07, 2007: Message edited by: Grishma Dube ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

i want to fetch entire list

Just hoping that the list is not huge


[My Blog]
All roads lead to JavaRanch
Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
hmmm..even i am afraid of that..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

There's an entry in the FAQ about pagination :
http://faq.javaranch.com/view?PaginationOrPaging
Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245
Why don't you check 'user entitlements' etc. in the servlet? Then pass the data to the servlet?

Depending on the type of data you have would it be possible for you to modify the query to check 'user entitlements'??
sreekanth nair
Greenhorn

Joined: Mar 12, 2007
Posts: 20
Check the CSS style property "pagination" will help you out.you just have to put some logic how to loop through your data. check www.w3schools.com or any other site for CSS and check for "pagination"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

CSS pagination controls how pages get printed. It has nothing to do with paginating data on a JSP page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pagination in JSP