You can put what ever you like in the tile attributes. I store the
resource keys so that they can be looked up depending on locale.
Example - using a welcome page and a view shopping cart page
In your tiles definition
welcome page:
<definition ...>
<put name="title" value="welcome.title" />
...
</definition>
shopping cart page:
<definition ...>
<put name="title" value="cart.view.title" />
...
</definition>
In your template page
<tiles:importAttribute scope="request" />
<TITLE><bean:message name="title" /></TITLE>
</HEAD>
<BODY>
<tiles:insert attribute="head" />
<tiles:insert attribute="content" />
<tiles:insert attribute="footer" />
</BODY>
in your application.properties etc
welcome.title=Hello
cart.view.title=View Shopping Cart
Christian Hesse wrote:
Hi all!
I have a small problem:
I am creating a web-application with struts, which contains many jsp-pages. At the moment
I use the concept copy & pasting the layout into each page. I read much about
including parts by jsp-commands, templates and tiles and try to use tiles. But I do have
one big problem with that:
I have my template looking like that:
<TITLE><tiles:getAsString name="title" /></TITLE>
</HEAD>
<BODY>
<tiles:insert attribute="head" />
<tiles:insert attribute="content" />
<tiles:insert attribute="footer" />
</BODY>
I know, it looks nice, but I have the problem, that each page has to choose another title, which
is in my Ressource-Properties and to make it more complicated, I develop it with
internationalization. I also have to use the title in the "head"-section, but I think
the reuse is no problem.
How can I configure a key, which will be resolved in the RessourceBundles to give me
the language- and page-dependent title?
Any suggestions?
Bye
Christian
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Jason Lea
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]