FreeMarker recursive nested lists

Viewed 3001

I have a data structure that looks like this:

public class Foo {
    public Bar bar;
    public List<Foo> foos = new ArrayList<>();
}

Each instance of Foo can hold an arbitrary amount of FooS, which of course in turn can contain even more FooS and so on. So how would I go about making FreeMarker go through a list like that ?

2 Answers
Related