• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Paging -- Has anyone done it via Spring Framework?

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why dont you have a look at displaytag??
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic