eachError
目的 Purpose
Loops through each error of the specified bean or model. If no arguments are specified it will loop through all model attributes and check for errors.使用例 Examples
Loop through each error in the "book" bean:<g:eachError bean="${book}"> <li>${it}</li> </g:eachError>
<g:eachError bean="${book}" field="title"> <li>${it}</li> </g:eachError>
<g:eachError model="${[book1: book1, book2: book2]}" field="title"> <li>${it}</li> </g:eachError>
<g:eachError bean="${book}"> <li><g:message error="${it}"/></li> </g:eachError>
詳細 Description
属性 Attributes
bean
(optional) - The instance of the bean to check for errorsmodel
(optional) - The name of the model Map to check for errorsfield
(optional) - The field within the bean or model to check for errors for