You can create a Iterator class that traverses the tree structure. If you need to display the tree structure in the JSP page then the Iterator will need to maintain enough information about depth traversed/siblings to ensure that the tree structure can be rendered for each value iterated through. (The best way to encapsulate this presentation logic is to write a custom TagHandler).
Your classes would look something like: (Iterable object for creating the iterator) public class TreeWalker<T> implements Iterable<TreeNode<T>> (Iterator itself - provides methods to get the Tree Node, and info on the position within the Tree) public interface TreeNode<T> Cheers, Richard. -----Original Message----- From: Vinit Sharma [mailto:[EMAIL PROTECTED] Sent: Thursday, 6 April 2006 11:48 p.m. To: Struts Users Mailing List Subject: Tree display in JSP page Hi, I've a class, which looks like: public class Tree { private String label; private int level; private Tree childRef; private Tree siblingRef; private Tree startRef; } I'd like to diplay this data structure on my JSP page. Its a trick, as recursion is not possible in JSP as compared to what we can do in a normal class, any idea how this can be done? Thanks, -- Vinit Sharma IBM --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]