java - JSTL using var in foreach items -
i have c:foreach, iterates let's 20 24
<c:foreach var="i" begin="20" end="24">
and inside it, c:foreach
<c:foreach items="${'${i}'}" var="entry">
because pass controller multiple lists this:
for(team t : teams) { string name = team.getteamid() + ""; model.addobject(name, tabledata); }
where team object , model modelandview. controller seems work fine, in jsp used data it. can't items correctly.. need obtain items="20" when var 20 , don't know try anymore. there teams id 20 24, i've checked , error says either numberformatexceptions or don't know how iterate on provided items..
thanks in advance!
if want obtain items="20" in second foreach, can try this:
<c:foreach var="i" begin="20" end="24"> <c:set var="tmp" value="${i}"> <c:foreach items="${tmp}" var="entry"> ... </c:foreach> </c:foreach>
but seems "items" must iterable data.
Comments
Post a Comment