tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Kannenberg" <tkann...@celerasystems.com>
Subject Question re: attribute evaluation
Date Wed, 13 Feb 2008 18:09:24 GMT
My understanding is that if I specify body content for the <tiles:putAttribute>, that
content will be evaluated and the resulting string is what will be available for insertion
into my template using <tiles:insertAttribute>.  For example, I have myTemplate.jsp
which includes this:

   <table>
      <c:forEach begin="1" end="5" var="current">
         <tr>
            <tiles:insertAttribute name="rowContent"/>
         </tr>
      </c:forEach>
   </table>

and myPage.jsp which includes this:

   <tiles:insertTemplate template="/tiles/myTemplate.jsp">
      <tiles:putAttribute name="rowContent">
         <td><c:out value="${current}"/></td>
      </tiles:putAttribute>
   </tiles:insertTemplate>

Because ${current} is undefined when the body content is evaluated, this produces a table
with 5 rows, each of which contains a single cell with nothing in it.  Is this an unavoidable
consequence of the way Tiles works, or is there a way to make Tiles treat the content of the
putAttribute tag as a literal string to be inserted into the template and then evaluated along
with the rest of the template page?
 
Tim Kannenberg
Celera Systems LLC
 


Mime
View raw message