FYI, I have added (to the 2.3-gae branch) a new feature for the above,
as it was very often missed. Please tell your opinion, and also, try
to break this new feature!

Here's an example:

    <#assign m = { "a": 1, "b": 2 }>
    
    <#list m as k, v>
      ${k} = ${v}
    </#list>
    
    <#list m>
      <ul>
        <#items as k, v>
          <li>${k} = ${v}
        </#items>
      </ul>
    </#list>

which will print:

    a = 1
    b = 2

    <ul>
        <li>a = 1
        <li>b = 2
    </ul>

Loop variable built-ins like ?index, ?itemParity, etc. work both on k
and v, just as they worked on sequence items.

There's new optional interface that helps to implement this more
correctly and efficiently, TemplateHashModelEx2, which extends
TemplateHashModelEx; see in the JavaDoc of it.

-- 
Thanks,
 Daniel Dekany

Reply via email to