I am providing here the solution I found to my problem with tiles scope. The variable quote and row in c:forEach are in page scope. This is not available to other tiles. By using c:set I can either set these variables in request or session scope and it will work just fine. Does anyone know of a way to specify what scope these variable will be stored in without having to use c:set explicitly?
<c:forEach var="quote" items="${quoteForm.quoteValues}" varStatus="row"> <c:set var="quote" scope="request" value="${quote}"/> <c:set var="row" scope="request" value="${row}"/> <c:choose> <c:when test="${(row.count % 2) != 0}"> <tiles:insert definition=".quote.list.item.1" flush="false"/> </c:when> <c:otherwise> <tiles:insert definition=".quote.list.item.2" flush="false"/> </c:otherwise> </c:choose> </c:forEach> Thank you for your time, Jason Long CEO and Chief Software Engineer BS Physics, MS Chemical Engineering http://www.supernovasoftware.com -----Original Message----- From: Jason Long [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 2:20 AM To: 'Struts Users Mailing List' Subject: RE: Tiles scope headache assistance still needed. The problem is that I am trying to use a variable defined in a loop. It must be in page scope. I got the following to work without using any <tile:put/> or <tiles:importAttribute/> in any of my pages. When I tired to use <c:set scope="page"/> this approach failed. Request and Session scope worked just fine. <c:forEach var="quote" items="${quoteForm.quoteValues}"> <c:set var="quote" scope="request" value="${quote}"/> <tiles:insert definition=".quote.list.item" flush="false"/> </c:forEach> Thank you for your time, Jason Long CEO and Chief Software Engineer BS Physics, MS Chemical Engineering http://www.supernovasoftware.com -----Original Message----- From: Brian Moseley [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 2:13 AM To: Struts Users Mailing List Subject: Re: Tiles scope headache assistance still needed. Jason Long wrote: > I am still no closer to a solution to my problem with tiles. I will explain > the scenario again in hopes that someone will provide some insight into my > problem. i can't see anything with what you've provided. you should try getting this working with the smallest possible example. define a test tile which imports an attribute, and include it into a jsp putting the attribute. the following works for me: <definition name="layout.standard" page="/layout/Layout.jsp"> <put name="nav" value="/layout/Nav.jsp"/> </definition> Layout.jsp: <tiles:importAttribute name="nav"/> <tiles:insert attribute="nav" flush="false"> <tiles:put name="id" beanName="id"/> </tiles:insert> Nav.jsp: <tiles:importAttribute name="id"/> id: ${id} --------------------------------------------------------------------- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]