Hi,

There are two ways to do that:
- using cascade on an attribute in switchable-layout, it is automatically 
passed to all inserted definition in its template; you don't have to repeat the 
attribute in my.layout.
- if you want to specify a variable value in tiles:putAttribute, use the body 
of the tag instead of "expression".

Hope this helps,
Nick

On Mar 27, 2014 3:59 PM, Jose Luis Martinez Avial <[email protected]> 
wrote:
>
> Hello, 
>
>                 I'm using Tiles 2.2.2. I'm have a definition as follows: 
>
>
>
>        <definition name="switchable.layout" 
> template="/WEB-INF/jsp/switchable-layout.jsp"> 
>
>               <put-attribute name="content" 
> value="/WEB-INF/jsp/content-pane-title.jsp" cascade="true"/> 
>
>        </definition> 
>
>
>
>        I want to insert a definition inside switchable-layout.jsp; and I 
> would like to pass the attribute content to the definition in the jsp. It 
> should be something as follows: 
>
>
>
>                 <tiles:insertDefinition name="my.layout" flush="true"> 
>
>                                 <tiles:putAttribute  name="menu" 
> value="menu.chunk" cascade="true"/> 
>
>                                 <tiles:putAttribute  name="content" 
> expression="${content}" cascade="true"/> 
>
>                 </tiles:insertDefinition> 
>
>
>
>                 When I do that, I got the following error in the screen: 
>
>
>
> switchable-layout.jsp:40:39: Static attribute must be a String literal, its 
> illegal to specify an expression. 
>
>        <tiles:putAttribute  name="content" expression="${content}" 
> cascade="true"/> 
>
>                                              ^--------^ 
>
> switchable-layout.jsp:40:39: Static attribute must be a String literal, its 
> illegal to specify an expression. 
>
>        <tiles:putAttribute  name="content" expression="${content}" 
> cascade="true"/> 
>
>
>
>                 How can I pass the attribute from the original definition to 
> the inserted one? 
>
>
>
>                 Thanks 
>
>
>
> JL 
>
>
>
>
>
> ------------------------------- 
>
> José  Luis Martínez-Avial 
>
> Web Applications Global Head 
>
> Information Technology 
>
> Santander Private Banking 
>
>
>
> 1401 Brickell Avenue, Suite 1500, Miami FL 33131 
>
> Phone: 305.539.2417 
>
>
>
>
>
> Internet communications are not secure and therefore Banco 
> Santander International does not accept legal responsibility for 
> the contents of this message. Any views or opinions presented 
> are solely those of the author and do not necessarily represent 
> those of Banco Santander International unless otherwise 
> specifically stated. 
>
> Las comunicaciones vía Internet no son seguras y, por lo tanto, 
> Banco Santander International no asume responsabilidad legal 
> ni de ningún otro tipo por el contenido de este mensaje. 
> Cualquier opinión transmitida pertenece únicamente al autor y 
> no necesariamente representa la opinión de Banco Santander 
> International, a no ser que esté expresamente detallado.

Reply via email to