Hi All,
This is my first post to this forum so please let me know if I go off track.
Can someone help me with a jstl forEach issue I have. We have been provided with jsp pages from an external company that we now have to incorporate our variable data. This is received in the normal way via collections. The problem I have is that the pages are structured with a series of divs specifying column 1 followed by a series of divs specifying column 2 etc... Each item from the collection, however, corresponds to a row across each of these divs.
My first thought was to create variable fields from the collection so I could just place them into the right pages as below:
<c:set var="count" value="1" />
<c:forEach var="bookListEntry" items="${bookSearchResultList}" begin="${param.first}" end="${param.first + noOfRows - 1}">
<c:set var="who${count}" value="${bookListEntry.artistName}"/>
<c:set var="where${count}" value="${bookListEntry.countyName}"/>
<c:set var="cost${count}" value="${bookListEntry.costRangeFrom}"/>
<c:set var="bandIndex${count}" value="${bookListEntry.bandIndex}"/>
<c:set var="proFile${count}" value="${bookListEntry.proFile}"/>
<c:set var="count" value="${count+1}"/>
</c:forEach>
but according to the DTD atrribute var does not accept expressions. I'm using the begin and end attributes because I only want to partially traverse the collaction as there is a "next" and "prev" button at the bottom.
My question is, is there any way to create a variable "var" name or alternatively can anyone think of a better way to do this.
I hope this makes sense as it's always difficult to try and put into words something you've been working on for a while.
Thanks for any help.
Gareth

