wood burning stoves
The moose likes JSP and the fly likes Recursive Tree Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Recursive Tree Problem" Watch "Recursive Tree Problem" New topic

Recursive Tree Problem

Sanket L Shah
Ranch Hand

Joined: May 08, 2009
Posts: 49
Hi all,

I am developing one application using hibernate and JSP.
I am having one user class.

I have given lazy = "false" in user.cfg.xml. When I run this program using void main... it works well...
now my problem is how can I iterate loop so i can get all the data in tree structure...
I wanted to display the data in Tree Structure... but not able to write correct recursive loop...
Please help me out.....

Thank you so much....

Ankit Garg

Joined: Aug 03, 2008
Posts: 9435

Do you want us to tell you how to generate the HTML for that or what?? A general recursive solution to this problem would be that you create a method which accepts a User object, iterates over the List<User> and calls itself (i.e. recursive call to the method itself) with each element in the List...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link: http://aspose.com/file-tools
subject: Recursive Tree Problem
It's not a secret anymore!