You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gupta, Rahul" <RG...@amfam.com> on 2006/09/06 21:20:06 UTC
Sharing variables between Tiles
Hi,
I have a page with three tiles. Is there a way to share a variable
between these tiles?
I want to set the variable in one tile and access its value in the other
two tiles. I don't know if it is relevant - I am using tile controllers
to populate data needed by each of the tiles to draw that tile.
Following is the layout page.
I will appreciate any help.
Thanks,
RG
<table width="100%">
<tr>
<td><tiles:insert definition=".A"/></td>
</tr>
<tr>
<td><tiles:insert definition=".B"/></td>
</tr>
<tr>
<td><tiles:insert definition=".C"/></td>
</tr>
</table>
<definition name=".A" path="/a.jsp" controllerClass="ATileController" />
... similar tile definitions for B & C.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Sharing variables between Tiles
Posted by David Friedman <hu...@ix.netcom.com>.
I think I once did it but you have to put each variable inside each section.
It make the config look very redundant. I probably got it from the Demoulas
(spelling?) PDF. I think I used it once ages ago and no, I don't have the
sample anymore. It was too cumbersome in my opinion.
Regards,
David
-----Original Message-----
From: Antonio Petrelli [mailto:brenmcguire@tariffenet.it]
Sent: Thursday, September 07, 2006 3:14 AM
To: Struts Users Mailing List
Subject: Re: Sharing variables between Tiles
Gupta, Rahul ha scritto:
> Hi,
> I have a page with three tiles. Is there a way to share a variable
> between these tiles?
>
AFAIK you cannot do it, anyway you can store your variable in request
scope and access it with JSP tags.
HTH
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Sharing variables between Tiles
Posted by Antonio Petrelli <br...@tariffenet.it>.
Gupta, Rahul ha scritto:
> Hi,
> I have a page with three tiles. Is there a way to share a variable
> between these tiles?
>
AFAIK you cannot do it, anyway you can store your variable in request
scope and access it with JSP tags.
HTH
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org