• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A Pagination Technique Using Spring 3

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to incorporate pagination in my spring 3 MVC application. Is there any standard pagination component spring provides?

Any good example I can refer to?

Thanks,
Sachin
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well depends what you mean by 'pagination'

You can have a look at PagedListHolder there is a little example on the link below:

http://stackoverflow.com/questions/2245035/how-to-implement-pagination-in-spring-mvc-3

If you are just trying to paginate data from the database that your are retrieving in your services you can do it write it yourself or if you are using spring-data-jpa they have some nice pagination stuff as well.

Depending on how you are displaying your data you might want to look at some of the nice jquery data table options there are a couple out there I have used. I really cant give you more without more detail as to what you are trying to do.


Bill
 
sachin pachpute
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,

I am using jsp, Spring 3, Hibernate and MySQL. I am retreiving article list from service and displaying on jsp page. Implementation is something like below,

Controller code


on my JSP, I am displaying

ArticleTitle
ArticleRent
ArticleDescription
ArticleUserFirstName
ArticleUserLastName
ArticleImage

etc....

How to set list in PageListHolder and how to use it in jsp? I want JSP to have buttons like Next, previous, 1, 2, 3 like we see on most of the applications for going to next page, previous page or specific page.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you click the link Bill gave you? That gives you all the information you need. It even has sample code. All done for you.

Sorry, but we can't do all your work.

Mark
 
sachin pachpute
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks Bill. I could work on this piece only yesterday and it didn’t even take an hour. Never thought it would be that straightforward

Another good example I found was,

http://www.developer.com/java/web/article.php/10935_3830886_2/A-Pagination-Technique-Using-Spring.htm
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your very welcome Sachin I am glad you got it all worked out
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic