Japanese GSP Tag - each

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>
With a named item: ??????????????
<g:each var="book" in="${books}">
<p>Title: ${book.title}</p>
<p>Author: ${book.author}</p>
</g:each>
Another example, where a named item is necessary (otherwise the access to the title property will fail): ???????????????????? (??????????????????????????????)?
<g:each in="${itemList}" var="item">
<g:link action="show" id="${item.id}">${item.title}</g:link>
</g:each>