You could create your own bean with nested menuitems,

class MenuItem {
   ...
    List getItems() {
       return items;
    }
   ...
    void addMenuItem(MenuItem item) {
       this.items.add(item);
    }

    //and so on
}

You can use <bean /> in tiles config, tiles controller or even a
servlet that places the menu in the application context (no tiles).
The tiles config gets a but uglier (if you go that route) , but jsps
come out cleaner..

mark



On 1/9/06, Keith Sader <[EMAIL PROTECTED]> wrote:
> Greetings, I've google'd the web and I haven't found any good advice
> on how to make submenus with tiles.
>
> What I have is a menu structure like this
>
> Item1
>   subitem1
>   subitem2
> Item2
>   subitem2
>   subitem2
> ...
>
> How would I define this in a tiles-def?  What I have so far is
> something that looks like this:
>
> <definition name="left.menu" path="/common/leftMenu.jsp" >
>         <putList name="menuItems">
>                 <putList name="Item1">
>                         <item value="subitem1" link="#"/>
>                         <item value="subitem1" link="#/>
>                         <item value="subitem1" link="#"/>
>                 </putList>
>                 <putList name="Item2">
>                         <item value="subitem2" link="#"/>
>                         <item value="subitem2" link="#/>
>                         <item value="subitem2" link="#"/>
>                 </putList>
>         </putList>
> </definition>
>
> However, this makes the iteration over the items ugly in the .jsp.  Is
> there an easier/better way to get what I'm after?
>
> thanks,
> --
> Keith Sader
> [EMAIL PROTECTED]
> http://www.saderfamily.org/roller/page/ksader
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to