File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes A Pagination Technique Using Spring 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "A Pagination Technique Using Spring 3" Watch "A Pagination Technique Using Spring 3" New topic
Author

A Pagination Technique Using Spring 3

sachin pachpute
Ranch Hand

Joined: Aug 05, 2004
Posts: 35
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
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

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


[How To Ask Questions][Read before you PM me]
sachin pachpute
Ranch Hand

Joined: Aug 05, 2004
Posts: 35
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.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
sachin pachpute
Ranch Hand

Joined: Aug 05, 2004
Posts: 35

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

Joined: Mar 07, 2010
Posts: 1632
    
    7

Your very welcome Sachin I am glad you got it all worked out
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A Pagination Technique Using Spring 3
 
Similar Threads
Pagination
Pagination
Pagination
Pagination
PAGINATION