Iterating through a map in Freemarker

/ Published in: Java
Save to your folder(s)

Iterating through a map in Freemarker. We have the tags ?keys and ?values which will give the keyset and valueset respectively. One thing we have to be carefull is if we have to use map[key] the key should be a string

Copy this code and paste it in your HTML
  1. <#list map?keys as key>
  2. ${key} - ${map[key]}
  3. </#list>


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.