How can I process PagedListHolder in JSP?
In my controller I have this:
PagedListHolder<Logo> pagedListHolder = new PagedListHolder<Logo>(listLogo);
pagedListHolder.setPageSize(2);
and in my jsp:
<c:forEach items="${pagedListHolder}" var="listHolderItem">
But it does not work. JSTL can not iterate over pagedListHolder;
#newer mind, I got it:
in order to process PagedListHolder list you need to get de list back from the PagedListHolder. This is how you do it:
PagedListHolder<Logo> pagedListHolder = new PagedListHolder<Logo>(listLogo);
pagedListHolder.setPageSize(2);
List<Logo> pagedListLogo = pagedListHolder.getPageList();
model.addAttribute("pagedListLogo", pagedListLogo);
in your jsp:
<c:forEach items="${pagedListLogo}" var="logo">
...
voila, it works. :)
As you noted, you should get the list. Two ways to do that:
model.addAttribute("list", pagedList.getPageList())
<c:forEach items="${list.pageList}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With