Groovy web console

subscribe to the feed Subscribe
to this
site

SO

Published 1 week ago by m
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def values = [ "1", "2", "3" ]
def engine = new groovy.text.SimpleTemplateEngine()
def text = '''
<% for (item in values) { %>
<%= item %>
<% } %>
'''
println engine.createTemplate(text).make([values: values])