3

Let's say i've list of objects that i want to iterate in stringTemplate. the object look like that:

public class a1 {

private String name;
private String value;
private List<a2> a2list;
 public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getValue() {
    return value;
}
public void setValue(String value) {
    this.value = value;
}
 public List<a2> geta2list() {
    return a2;
}

}

public class a2 {

private String name;
private String value;
 public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getValue() {
    return value;
}
public void setValue(String value) {
    this.value = value;
}

}

imagine something like a conversation. a1 is the creator and a2 is answers. i did that:

$a1:{

    <div>$it.value$</div>
   $a2:{

      <div>$it.name$</div>
      <div>$it.value$</div>
      }$

}$

and i'm getting "action parse error;"

any ideas?

Thanks! Koby

I82Much
  • 26,901
  • 13
  • 88
  • 119
koby
  • 665
  • 2
  • 6
  • 15
  • Please let me know if what you had asked had worked. I am trying to so a similar task, and not able to iterate through a List within a List. Please Help !!! – AnirbanDebnath Apr 06 '16 at 17:57

1 Answers1

1

What's the syntax error? Perhaps you need <...> not $...$

Terence Parr
  • 5,912
  • 26
  • 32