[
https://issues.apache.org/jira/browse/GROOVY-9507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun resolved GROOVY-9507.
--------------------------------
Resolution: Fixed
> JSP style loop in StreamingTemplateEngine template results in
> TemplateParseException
> ------------------------------------------------------------------------------------
>
> Key: GROOVY-9507
> URL: https://issues.apache.org/jira/browse/GROOVY-9507
> Project: Groovy
> Issue Type: Bug
> Components: Templating
> Affects Versions: 3.0.3
> Reporter: Christopher Chase
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 4.0.0-alpha-1, 3.0.4
>
>
>
> The example below works as expected when run in Groovy 2.5.8, yet it fails
> when run in Groovy 3.0.3
>
>
> {code:java}
> TemplateEngine engine = new StreamingTemplateEngine()
> Template template = engine.createTemplate('''
> <ul>
> <% items.each { %>
> <li>${it}</li>
> <% } %>
> </ul>
> ''')
> println template.make([items : [1,2,3,4]])
> {code}
>
> Expected output (and the output 2.5.8 yields):
>
> {noformat}
> <ul>
>
> <li>1</li>
>
> <li>2</li>
>
> <li>3</li>
>
> <li>4</li>
>
> </ul>
> {noformat}
>
> Exception 3.0.3 gives:
>
> {noformat}
> Exception in thread "main" groovy.text.TemplateParseException: Template parse
> error 'Unexpected input: '{'; Expecting RBRACE ' at line 3, column 27
> 2: <ul>
> --> 3: <% items.each { %>
> 4: <li>${it}</li>{noformat}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)