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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -