简体   繁体   中英

GSP use set variable as counter

I have a problem using a variable from a webflow as a counter

I tried several possibilities

 <g:set var="count" value="${flow.ipcount  as Integer}" />
                 <g:each in="${ (1..'${count}' ) }">

and

<g:set var="count" value="${flow.ipcount}" />
                 <g:each in="${ (1..'${count}' ) }">

But I get only an error: Message:java.lang.String cannot be cast to java.lang.Integer

您不需要内部的${}

<g:each in="${ (1..count) }">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM