Tuesday, March 15, 2011

Dynamic tree on jsp with recursive calling

Set the Object ( which has children) to request attribute and forward to jsp ( ex main.jsp)


Take intermediate jsp ( node.jsp) and include below code ( calling recursively)
${node.title}
< div>
< c:foreach var="node" items="${node.children}">
<c:set var="node" value="${node}" scope="request"/>
< /c:foreach>
< /div>

And in main jsp include the node.jsp like