Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pagination in JSP

 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to fetch entire list

Just hoping that the list is not huge
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm..even i am afraid of that..
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an entry in the FAQ about pagination :
http://faq.javaranch.com/view?PaginationOrPaging
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS pagination controls how pages get printed. It has nothing to do with paginating data on a JSP page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic