aspose file tools*
The moose likes Struts and the fly likes Dynamic, server-side construction of the tree, reading from a database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic, server-side construction of the tree, reading from a database " Watch "Dynamic, server-side construction of the tree, reading from a database " New topic
Author

Dynamic, server-side construction of the tree, reading from a database

R .sourav nayak
Ranch Hand

Joined: May 14, 2006
Posts: 67
hi,
i have to represent the data in a tree structure format in my jsp page. The datas are stored in the database in tree structure way. i just need to write a java class which can help me to display those data in tree strutcure way.

Could some one tell me how to do that or provide me some good link on this.

thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

I guess I'd start with figuring out how the tree will be represented in HTML and start from there.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
R .sourav nayak
Ranch Hand

Joined: May 14, 2006
Posts: 67
Hi Bear,
thanks for the immediate response. I have already created the tree structure in my html by puting the hardcoded datas and the structure looks like following :

but now i wanted to get those datas in tree structure way from the database
since my application is struts based, in my action class ,i am able to iterate though the nodes and leaf nodes. But the problem i am having is - in my action class i am not able to keep that temporarly in a tree structure way as i go through each iterator. so its being problem for me to display that on jsp page.

Could you provide me some hint

thanks in advance

[BPSouther: Added code tags]
[ November 08, 2007: Message edited by: Ben Souther ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Dynamic, server-side construction of the tree, reading from a database