tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JRD <danger_...@hotmail.com>
Subject Iterate through Attributes
Date Tue, 15 Apr 2008 16:53:15 GMT

We are migrating an app from Struts1/Tiles1 to Struts2/Tiles2

We have a bunch of different transactions types that all collect similar
data (Addresses, dates, text inputs, etc...).  We use tiles as a view
controller (among other things).

So for each thing we want to display we would have a read-only and a
data-entry display.  The view controller would use state and security to
determine what view was appropriate, and then pass along all of the original
data passed in to the correct view.

In Tiles 1 our view controller looked like this:

<c:set var="tilesKey" value="org.apache.struts.taglib.tiles.CompContext"/>
<cw:set var="theTiles" bean="${tilesKey}"/>

...select view...

<tiles:insert definition="${definition}">
	<tiles:put name="viewFormat" value="${viewFormat}"/>
	<c:forEach items="${theTiles.attributeNames}" var="attribute">
		<tiles:put name="${attribute}"><tiles:getAsString
name="${attribute}"/></tiles:put>
	</c:forEach>
</tiles:insert>

The view selector can not know what attributes to pass along since each
thing we want to display has different attributes.  Any idea how to do this
in Tiles 2?

Thanks in advance,
Jonathan
-- 
View this message in context: http://www.nabble.com/Iterate-through-Attributes-tp16702610p16702610.html
Sent from the tiles users mailing list archive at Nabble.com.


Mime
View raw message