<g:each in="${business}" status="i" var="businessInstance">
<tr class="${(i % 2) == 0 ? 'odd' : 'even' }">
<td>${fieldValue(bean: businessInstance, field: "id") }</td>
<td>${businessInstance.id}</td>
</tr>
</g:each>
In above example, both first and second table data results same value. Is there any difference in those two cases?
fieldValue
escapes the value by calling encodeAsHTML()
to guard against XSS attacks, so it's much safer to use. It also formats numbers according the the current locale.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With