Here is a sample code that uses the while tag:
<g:set var="counter" value="${0}"/> <g:while test="${counter < 5}"> <g:set var="counter" value="${counter+1}"/> <p>The value is ${counter}</p> </g:while>
This is the output of the code in HTML:
<p>The value is 1</p> <p>The value is 2</p> <p>The value is 3</p> <p>The value is 4</p> <p>The value is 5</p>