You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mosho <ro...@gmail.com> on 2006/08/03 19:55:51 UTC
how to pass attribute values from bean in tiles
Hi,
I have property pageTitle in my java bean.
How can I pass that value to tile attribute?
i have xml file, where I am defining my tile definitions.
For example, if I include
<tiles:insert attribute="title" beanName="pageTitle"
beanProperty="common.Page" ignore="true"/>
Thanks
--
View this message in context: http://www.nabble.com/how-to-pass-attribute-values-from-bean-in-tiles-tf2047115.html#a5637498
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: how to pass attribute values from bean in tiles
Posted by Antonio Petrelli <br...@tariffenet.it>.
mosho ha scritto:
> Hi,
>
> I have property pageTitle in my java bean.
> How can I pass that value to tile attribute?
> i have xml file, where I am defining my tile definitions.
>
> For example, if I include
> <tiles:insert attribute="title" beanName="pageTitle"
> beanProperty="common.Page" ignore="true"/>
>
>
Errr... no, you need to know that:
1) there is a "receiving tile" that exposes an attribute
2) there is a "sending tile" that puts the value in the attribute (note
that I invented these terms right now :-) )
So in your "receiving tile" (let's call it "/receingTile.jsp") you
expose your attribute the usual way:
<tiles:insert attribute="title" />
In your sending tile you have to fill it:
<tiles:insert template="/recevingTile.jsp">
<tiles:put name="title" beanName="myBean" beanProperty="pageTitle"
beanScope="???" />
</tiles:insert>
HTH
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org