I am using (jquery) dynatree with struts. The items on the tree will be created this way:
I can't really help you because you did not post any code and stackoverflow is not the place to ask someone to write code for you.
What I would suggest doing is going to the Dynatree Example Page and looking at all the different tree examples they have posted there. Under each tree example there is source code for that particular example. Pick the example that best represents what you want to do in your project, and then try to modify it to what you exactly want. Then when / if you have problems, edit your post with code so we can help you.
Also you can check out these pieces of documentation that will help you.