Traversal in freemarker

List<Question> question = new ArrayList<Question>();
Map<Question, List<Option>> mapping = new LinkedHashMap<Question, List<Option>>();

1
2
3
4
5
6
7
<#if question??>
<#list question as ask>
<#list options[ask.id?c] as option>
<#if option.status = 0>right<#else>false</#if>
</#list>
</#list>
</#if>
  • Is freemarker’s key only be String -_- shit.
  • Why can’t use object as a key
  • Use ?c transform int varable to string