This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Paging -- Has anyone done it via Spring Framework?

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I am using the regular Controller to implements my web application. Has anyone using the spring bean to do the paging through record and display in the jsp.
something like this:

1 2 3 4 5 6....Next.

please advise or giving some hints.
Thanks
 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dont you have a look at displaytag??
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
spring provides "org.springframework.beans.support.RefreshablePagedListHolder" class for pagination.
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am new to the spring frame work and I too need to know the same. Itried to look in the net to get some idea about the usage of the PagedListHolder but didn't get much. Could you sypply some code or some location from where I can get some idea of this. It would be greatly helpful.

Thanks for the idea anyway.

Kaustabh
 
jay lai
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, again:
I read through and research on internet about RefreshablePagedListHolder, PageListHolder, But if anyone has actually implemented and give some snippit code, it would be really helpful.
Many thanks in advance
 
sandy patil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi following code snippet may be useful,

listHolder = new RefreshablePagedListHolder();
listHolder.setSourceProvider(new SourceProvider());
request.getSession(true).setAttribute("records", listHolder);
BindException ex = BindUtils.bind(request, listHolder, "records");
return new ModelAndView(mainView, ex.getModel());

Here SourceProvider class implements PagedListSourceProvider and defines loadList method which returns List of records. In JSP you can access parameters like records.pageSize, records.pageCount, records.firstLinkedPage etc through ${} and using
<c:forEach items="${records.pageList}" var="rec">
<c ut value="${rec.name}"/>
</c:forEach>
You can iterate through records.
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!