You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Konstantina Stamopoulou <st...@intracom.gr> on 2002/03/26 15:07:08 UTC

How to iterate in this case??

Hello,
I need to implement the following and I have reached a dead end. Can you help me?
I have the some data in my .xml described below:
 
<node name="dir1" >
        <child name="file1" link="/dir1/file1"/>
        <child name="file2" link="/dir1/file2"/>
        <node name="dir2">
                <child name="file3" link="/dir1/dir2/file3"/>
                <child name="file4" link="/dir1/dir2/file4"/>
                 <node name="dir3"/>
         </node>
         <node name="dir4">
                <child name="file5" link="/dir1/dir4/file5"/>
         </node>
       
</node>    

which represents the  information:

  RootDir
     |___dir1
            |__file1
            |__file2
            |__dir2
            |    |__file3
            |    |__file4
            |    |__dir3
            |__dir4
                |__file5


I have a bean that holds the directories under root dir and the set of directories under each dir. My question is:
How should I use the <logic:iterate> or <nested:iterate>  tag in order to construct the tree that I have just described?
Any ideas? Should I change the way I have constructed my .xml file?


Thank you,
Konstantina