I assume by the "tile" you mean the JSP page that is referenced in the tiles xml, if that is how you are doing it. If so, you just reference a bean property on the JSP page. Again, what is the problem. This is simple. I always do this without any difficulty. Here is something I have in one tiles layout JSP page:

        <title><bean:write name="gui_data" property="scheme.title" /></title>

This obviously calls a bean referenced as "gui_data" and calls another object in that bean with a getScheme() method and the title with a getTitle() method. I must misunderstanding the problem, because this is simple to do and you must know this. 'Hope this is helpful.

Michael

At 03:41 PM 5/21/2004, David Friedman wrote:
Tim,

Why not use a TilesAction (org.apache.struts.tiles.action package) and
change/set tiles attributes using the putAttribute() method of the
ComponentContext object.  For more details, see the advances tiles PDF.

-David

-----Original Message-----
From: Michael McGrady [mailto:[EMAIL PROTECTED]
Sent: Friday, May 21, 2004 6:34 PM
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: RE: Tiles and changing the title based on content


I am not sure why this is a problem. All you have to do if you want part of the response object to be dynamic is put your dynamic value in the tile. Presumably you have some dynamic factor choosing the tiles content page. Just have that same factor decide what the value of the title is. There are lots of ways to introduce dynamic content. I don't see the problem.

Michael

At 11:24 AM 5/21/2004, Tim Penhey wrote:
>That requires a static titleKey in the tiles-def.xml, whereas I am dealing
>with a name
>property from a bean that comes from a database.
>
>Tim
>
> > -----Original Message-----
> > From: Niall Pemberton [mailto:[EMAIL PROTECTED]
> > Sent: 21 May 2004 17:48
> > To: Struts Users Mailing List
> > Subject: Re: Tiles and changing the title based on content
> >
> >
> > <fmt:message><tiles:getAsString name="titleKey"/></fmt:message>
> >
> > ----- Original Message -----
> > From: "Tim Penhey" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Friday, May 21, 2004 4:59 PM
> > Subject: Tiles and changing the title based on content
> >
> >
> > > I was wondering if there is any way to change the title based on the
> > content of a tiles
> > > based page?
> > >
> > > I have a current JSP where the title is:
> > > <title>${item.name}</title>
> > >
> > > Do people have any solutions to this?  At the moment my layout has the
> > following:
> > >
> > > <c:set var="titleKey"><tiles:getAsString name="titleKey"/></c:set>
> > > <title><bean:message key="${titleKey}"/></title>
> > >
> > > Preferably a simple solution, otherwise I'll have to move my dynamic
> > titles to something
> > > static.
> > >
> > > Tim
> > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to