Last updated by admin 3 years ago
?? - each
?? Description
Uses the Groovy JDK each method to iterate over each element of the specified object Groovy JDK each?????????????????????????????????(???????)?????? Parameters
- in - ????????????? The object to iterative over
- var (??) - ?????? g:link. ??????????? ?? ??????????????????????????? The name of the item. Note that this must be specified when the iterator value is to be used from within the body of a GSP Dynamic Tag, such as in g:link. See the example below.
? Examples
<g:each in="${books}"> <p>Title: ${it.title}</p> <p>Author: ${it.author}</p> </g:each>
<g:each var="book" in="${books}"> <p>Title: ${book.title}</p> <p>Author: ${book.author}</p> </g:each>
<g:each in="${itemList}" var="item"> <g:link action="show" id="${item.id}">${item.title}</g:link> </g:each>



