I am working on my website and trying to print out portfolio objects from the database. The page where I print them out to has pagination.
I use a script to create a new page when the following tag is used:
<div class="pics">
...
</div>
A maximum of 8 anchor tags only should go inside the above div. The anchor tags aren't anything special, they do use <s:property>
tags but that's about it.
In order to achieve this functionality, I've tried the following:
<c:set var="counter" value="0"/>
<s:iterator value="allPortfolio">
<c:if test="${(counter mod 8) == 0}">
<div class="pics">
</c:if>
<a href="<s:property value="filename">">Download</a>
<c:if test="${(counter mod 8) == 0}">
</div>
</c:if>
<c:set var="counter" value="${counter+1}"/>
</s:iterator>
This code, however, creates 11 pages (1 per portfolio object in my database). Where it should create just 2 pages with 8 items on the first and the remaining 3 on the second.
In other words, there should be just 2 of
<div class="pics">
...
</div>
One with 8 anchor tags in and one with 3 anchor tags in.
Instead, this is the code that gets created once the page loads:
<div class="pics">
<a href="1ba918625bca57f6e059c2d05393010b04da5ed6.png">Download</a>
</div>
<a href="ec49d4ca243a481b7fa819dfea783e0dd8f5a431.jpg">Download</a>
<a href="1b4ab5a3bebdf88045ef3818e852185c86e33048.png">Download</a>
<a href="e12eaed32a97bb78ddd863696ca510d943c4d978.png">Download</a>
<a href="2b6ee029b3fcef21b0a220a6b14de16206ce588b.png">Download</a>
<a href="e3e94e7ac6bfb09ca012d30912525848f2d361ed.png">Download</a>
<a href="f07e24b31fb65e38aa3d4bbe97a24a71c281aae7.png">Download</a>
<a href="dd41b536ca45642fa9827311498b9480d6df9be8.png">Download</a>
<div class="pics">
<a href="a2ad0d4b73daa3311e9f9b16dcd7d9476cd6e748.png">Download</a>
</div>
<a href="45fa47125a5dfe3608d6d80fb0a9ba1f5c444264.png">Download</a>
<a href="ee9b1571aa22e935772792ac363cc95e2a77bdfd.png">Download</a>