Dear list,
given that I have a JavaBean Strutcture that exposes a tree of some
form. Each node contains a String and any number of children. I would
like to render such a Bean into a site-map like html page via jsp code.
The interesting part, though, would be a tree-pendant to
<logic:iterate>. What I have in mind is s.th. like this
<logic:treeIterate bean="nameOfMyBean" type="string">
<preStepDown>
<ul>
</preStepDown>
<item>
<li>
... output the name of the node ... (via bean:write for
example)
</li>
</item>
<postStepDown>
</ul>
</postStepDown>
</logic:treeIterate>
Which would give as output something like this (rendered by:
aleitner-is-not-lynx-v-0.0.1):
* Item 1
* Item 1.1
* Item 1.2
* Item 2
* Item 3
* Item 3.1
* Item 3.2
* Item 3.2.1
* Item 3.2.2
(generated html-source)
<ul>
<li> Item 1 </li>
<ul>
<li>Item 1.1</li>
<li>Item 1.2</li>
</ul>
<li> Item 2 </li>
<li> Item 3 </li>
<ul>
<li> Item 3.1 </li>
<li> Item 3.2 </li>
<ul>
<li> Item 3.2.1 </li>
<li> Item 3.2.2 </li>
</ul>
</ul>
</ul>
given the right tree-bean of course (;
Now my question, does such a tag-lib exists? I have implemented a few
simple highly specialized beans for the project I am working on, but I
have no idea how to write such nested and interdepended tags. If no such
libraries exist, can somebody give me some hints for how I should go for
implementing such a thing?
Many thanks in advance,
Andreas