NimChimpsky
NimChimpsky

Reputation: 47290

Freemarker nested list

this works fine:

<#list myObjects as myObject>
  <tr>
    <td>${myObject.person.surname}</td>
    <td>${myObject.myListOfCountries[0].city.name}</td>
  </tr>
</#list> 

However if I instead try to create a nested list like so, which does not work :

<#list myObjects as myObject>
  <tr>
    <td>${myObject.person.surname}</td>
    <#list myObject.myListOfCountries as item>
       <td>${item.city.name</td>
    </#list> 
  </tr>
</#list> 

the error I receive is shown below :

freemarker.core.ParseException: Encountered "/"

Any ideas what causes the error - are nested lists allowed in freemarker ?

Upvotes: 7

Views: 13435

Answers (1)

dogbane
dogbane

Reputation: 274612

You haven't closed your brace. It should be:

<td>${item.city.name}</td>

Upvotes: 11

Related Questions