May I suggest to instead of using the "title" value in the tiles, use the keys (e.g. "titleKey"), then fetched it using whatever approach you want to:

Example:

resource_en.properties

application.title=Hello World Application


tiles.xml

<definition name="foo" extends=".template">
  <put name="titleKey" value="application.title" type="string"/>
</definition>

jsp page

<c:set var="titleNameKey"><tiles:getAsString name="titleKey"/></c:set>

<fmt:message key="${titleNameKey}"/>

(of course this uses unnecessary code, but the above will work for sure)

Hope this helps!


Peter Rumstle wrote:
Hi everyone, I am running into what appears to be a limitation in tiles. I hope someone has encountered this problem before and knows of a workaround.
I have a tiles based layout that accepts a "title" in the tiles definition.

    <definition name="recordDetail" extends=".template">
        <put name="title" value="Record Detail"/>
        <put name="body" value="/WEB-INF/jsp/tiles/recordDetail.jsp"/>
    </definition>

My problem is that I need the title to be more dynamic.  It needs to do two 
things:

1. Support different titles depending on the locale.
2. Accept a dynamic field identifying the record number that the page is 
showing.

For example, rather than say "Record Detail" like in my example it should say "Record Detail: 
38847829" and in other languages it should be translated using an existing ResourceBundle (ex. 
"Detalle De registro: 38847829").

My problem lies in the fact that my .template tile includes the <title> tag, but does not 
know which page it is rendering.  Only the "body" tile and the actual tiles 
definition knows which page it is rendering for.  Other pages use the same .template tile but 
require different dynamic fields in their title.

Has anyone got something like this working before?

Thanks!

_________________________________________________________________
Introducing the City @ Live! Take a tour!
http://getyourliveid.ca/?icid=LIVEIDENCA006

--

Alberto A. Flores
http://www.linkedin.com/in/aflores


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

Reply via email to