struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinit Sharma" <>
Subject Re: bean:define in including jsp
Date Mon, 24 Apr 2006 13:14:57 GMT
Hi Dilip,

You can define the bean in tiles def to use it across the pages.

The <put> tag is used to associate a value to an attribute. It allows
specifying the attribute name and its value. The attribute value will be
retrieved by its name.
The value can be specified in several ways:
> as a bean defined in some scope:
<tiles:put name="title" beanName="aBean"
The bean identified by "beanName" is retrieved, and its value used as
attribute value.
"beanScope" is optional, if not specified, bean is searched for in scopes in
the following
order: page, request and application. Scope "tiles" means the current Tile's
context (if
any). In this case, "beanName" identifies a Tile attribute name.
> as property of a bean defined in some scope:
<tiles:put name="title" beanName="aBean" beanProperty="aProperty"
This is a variant of the previous case. The value is not the retrieved bean,
but the returned value of the specified bean property.


you can also explore topic 1.2.5 here:


On 4/21/06, Dilip Ladhani <> wrote:
> Hey guys,
> We us Struts with tiles and here is something, I am having some trouble
> with.
> I have a main jsp (a.jsp). This jsp includes a few other jsps (using
> <tiles:insert
> attribute="b"/>, where b=b.jsp).
> Now, if I have a bean:define in a .jsp (eg  <bean:define name="aForm"
> property="prop" id="prop1" />), prop1 is usable in a.jsp, but not in
> b.jsp(the included or inserted jsp). Is this because, the tiles stuff
> is
> evaluated before the struts tags?
> If so, how can I have a bean:define in an including jsp, which can be used
> in all the included jsps? If I add this bean :define,  in b.jsp, it is
> obviously accessible in b.jsp, but I don't want to add bean:define in
> every
> included jsp .
> thanks,

Vinit Sharma

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message