Let's say I have a recursive data structure
class Tree {
private Tree right;
private Tree left;
private int data;
....
}
I want to convert it to xml with jsp, so my ui tree widget can load the xml page with Ajax and construct a tree (with expandable/collapsable nodes, etc).
The xml would look something like this:
<tree>
<tree>
<data value="5"/>
</tree
<tree>
<data value="1"/>
<tree>
<data value="5"/>
</tree
<tree>
<data value="1"/>
</tree>
</tree>
</tree>
Can such a recursive structure be generated with jsp? How?