struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghuveer" <raghuve...@infotechsw.com>
Subject RE: variable in one tile to another
Date Wed, 12 Apr 2006 05:03:40 GMT

Example:
a) I have variable as below in layot.jsp.
String strTemp="NEW";
how can i make this variable available in header,body and footer.
I was advised not to use requeset.setAttribute...
b ) I have some variables available in header.jsp by some jsp include
directive for plumtree application.
How can i make this variables available in body,footer.

At present ,I have included the directive in header,body,footer



-----Original Message-----
From: Greg Reddin [mailto:greddin@apache.org]
Sent: Tuesday, April 11, 2006 7:40 PM
To: Struts Users Mailing List
Subject: Re: variable in one tile to another



On Apr 11, 2006, at 1:43 AM, Raghuveer wrote:

> Is there a facility to get a variable in one tile from another tile in
> Struts Tiles

Sorry, I'm strapped for time, but I'll try to answer.

If you mean an attribute that is part of a Tiles definition then the
only ways I know of are to make one tile inherit from another or to
use a Tiles controller to pull the variable out of context.  If
you're just talking about a variable in the JSP page, you can put it
in page context or request scope in one tile and pull it in the other
tile.  I'd consider this a pretty dangerous practice though.  It
makes your app very fragile.  Simple changes such as the
rearrangement of the page could potentially break the app.

HTH,
Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message