struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Schyman <andreas.schy...@ctrl-ps.com>
Subject Feeding tiles:insert with bean:write?
Date Thu, 01 Aug 2002 11:22:20 GMT
Hi!

I'm trying to create a tiles-layout that will iterate over a putList
and insert each item as a tile, much as in the provided example
vboxLayout.jsp found in tiles-documentation.war. However, while that
example uses a java.util.Iterator to do this, I want to populate a
bean and iterate over it using logic:iterate, and this works fine,
but I can't feed the bean:write to tiles:insert. Can't I do this?


My template looks like this:
--------------------------------------------------------------------
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>

<tiles:importAttribute scope="page"/>

<logic:iterate id="module"
               name="modules"
               type="org.apache.struts.tiles.beans.MenuItem"
               scope="page">
<%-- This does not work --%>
	<tiles:insert name="<bean:write name="module"
                                       property="value"/>"/>
<%-- This works 
	<bean:write name="module" property="value"/>
--%>
</logic:iterate>
--------------------------------------------------------------------


When I run it with tiles:insert active, I get the following error:
--------------------------------------------------------------------
[ServletException in:/WEB-INF/jsp/layouts/moduleLayout.jsp]
/WEB-INF/jsp/layouts/moduleLayout.jsp(10,45) Attribute module has
no value'
--------------------------------------------------------------------


If this isn't possible, I guess I could use java.util.Iterator, but
I want to keep the tamplate as clean from java as possible.

Best regards,
Andreas

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message