<html>
<body>
<% [1,2,3,4].each { num -> %>
<p><%="Hello ${num}!" %></p>
<%}%>
</body>
</html>
8.2.1.2 Logic and Iteration
Version: 3.2.3
8.2.1.2 Logic and Iteration
Using the <% %>
syntax you can embed loops and so on using this syntax:
As well as logical branching:
<html>
<body>
<% if (params.hello == 'true')%>
<%="Hello!"%>
<% else %>
<%="Goodbye!"%>
</body>
</html>