struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Affan Qureshi" <>
Subject [Tiles] Design - Overriding <putList> items
Date Mon, 10 Mar 2003 04:40:14 GMT
I have divided the modules(logical) in my application in a Tab layout. I
want to show different pages under the same tab at various points in the
application. It means the putList items change all the time. If I want to
extend and override the values inside the putList tags I have to write the
whole putList tag again in the extended definition. Is this right or is
there a better way?

I have created a bean in which I keep values for links to display in each
tab and modify them at runtime in my Action classes. I put that bean in
session and copy its properties to the TilesContext in the controllerClass
actions. The problem is that this design is not very easy to maintain and
enhance. Also I get the values mixed up in the session which makes the user
go to a wrong page sometimes. And the layout code is all over the place
instead of a single, configurable one (like the XML file).

Is this the right design I have? Any suggestions/solutions?

Thanks a lot,

My Tiles Code below:

This is my basic/default definition:

<definition name="" path="/webpages/layouts/tabsLayout.jsp"
    <put name="title" value="MyAppName"/>
    <put name="header" value="/webpages/header.jsp"/>
    <put name="footer" value="/webpages/footer.jsp"/>
    <put name="selectedIndex" value="0"/>
    <put name="parameterName" value="selected"/>
    <putList name="tabList">
        <item value="Home" link="/webpages/home.jsp"
        <item value="Taxonomy" link="/webpages/template.jsp"
        <item value="Search" link="/webpages/search.jsp"

In actions i have the following code to set the values in the session bean:
        LayoutSettings settings =
        List tabList = settings.getTabList();
        SimpleMenuItem searchTab = (SimpleMenuItem)tabList.get(3);


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message