Hello,
i have somme trouble to find the syntax for freemarker with map of object
java code :
Map<Integer,PojoTest> mapTest= new HashMap<Integer,PojoTest>();
for (int i=0;i<5;i++) {
PojoTest pt= new PojoTest("test "+i);
mapTest.put(i, pt);
}
pojo:
package pojo;
public class PojoTest {
String testchamp;
public PojoTest(String string) {
this.testchamp=string;
}
public String getTestchamp() {
return testchamp;
}
public void setTestchamp(String testchamp) {
this.testchamp = testchamp;
}
}
freemaker:
<#list mapTest?keys as num>
${num} ${mapTest[num].testchamp}
</#list>
error:
For "...[...]" left-hand operand: Expected a sequence or string or something automatically convertible to string (number, date or boolean), but this has evaluated to an extended_hash (HashMap wrapped into f.t.DefaultMapAdapter):
==> mapTest [in template "Consultation/etudiant.ftl" at line 14, column 18]
is like if .testchamp is not the good syntax ... but i found nother the good one
thanks for any help