How to pass variable to tile (tiles library)
<p>I handle templates of my application using tiles library.</p>

<p>tile.xml:</p>

<pre><code>&lt;definition name="template1" template="/WEB-INF/template/default/template1.jsp"&gt;
   ...
    &lt;put-attribute name="menu" value="/WEB-INF/template/default/menu.jsp" /&gt;
   ...
&lt;/definition&gt;
</code></pre>

<p>template1.jsp</p>

<pre><code>&lt;html&gt;
    &lt;body&gt;   
        ...         
        &lt;tiles:insertAttribute name="menu" /&gt;                   
        &lt;tiles:insertAttribute name="menu" /&gt;  
        ...                 
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>As you can see I have to insert to tiles "menu". Since I have to dinamically print different menu inside "menu.jsp", how can I send 2 different variables to the 2 different tiles "menu"?</p>

<p>To be clearer</p>

<pre><code>   &lt;html&gt;
        &lt;body&gt;   
            ...         
            &lt;tiles:insertAttribute name="menu" /&gt; &lt;--- here I should pass a variable called menu1                   
            &lt;tiles:insertAttribute name="menu" /&gt; &lt;--- here I should pass a variable called menu2                    
            ...                 
        &lt;/body&gt;
    &lt;/html&gt;
</code></pre>

<p>Thanks everybody</p>