struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Caddel <>
Subject Advanced Tiles
Date Fri, 04 Apr 2003 18:49:11 GMT
After going thru Cedric's doc 
( on 
Advanced Tiles Features I came up with something that's a slight 
derivative of the example on page 15, right under where it says, 
"Example of a controller inserted as an URL:".  That example shows how 
to associate a controller with a tile definition. 

The point in doing that (as far as my wee little brain can tell) is to 
try and make each tile as autonomous as possible.  Right before each 
tile loads, an action gets invoked by the framework.  This gives you a 
chance to execute business logic and prepare the request for the tile 
that's about to load.

My issue is that I need a set of related actions to execute in an order 
that I can control before any of the tiles start to render. 

An example is a split screen where there is a tree of users displayed on 
the left, and a single user displayed on the right.  This screen has 
/ which preps the request for the tree, and / which 
handles all the user updates.  For the tree to display correctly I need 
/ to execute first (even though the tile it's associated with 
renders second), so that / has the updated information when it 
gets invoked.   Here are the relevant snippets I came up with to get 
this behavior:

At the top of layout.jsp:   <tiles:insert definition="user.controllers"/>

   <definition name="user.controllers" 
     <putList name="controllers">
         <add value="/admin/"/>
         <add value="/admin/"/>

<logic:iterate id="controller" name="controllers" type="java.lang.String">
   <tiles:insert page="<%=controller%>" flush="false"/>

This combination lets me execute an arbitrary set of actions in whatever 
order I want by simply editing tiles.xml.  Is this a clever thing to be 
doing?  A phenomenally bad idea?  Is there (as there usually is) a 
simpler/different way to get this behavior?  Any and all 
thoughts/comments/suggestions are welcome! 

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

View raw message