Vince,

You need to import the Tiles attribute before you reference it:

  <tiles:importAttribute name="titleKey" ignore="true" />
  <c:out value="${titleKey}" />

Thanks,
Paul

-----Original Message-----
From: Fumo, Vince [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 25, 2005 2:11 PM
To: 'user@struts.apache.org'
Subject: using <fmt:message> with Tiles and Struts


I am building a Struts Web application and I'm using Tiles for the first
time. I have it all set up and working nicely. My problem comes in the fact
that I want to use a standard messages.resources file for my page titles. 

For example

home.title=Main Home Page
info.title=Intro Page

etc.

I am used to setting the bundle at the top of the page like:

<fmt:setBundle basename="messages"/>

and then directly accessing keys as follows:

<fmt:message key="home.title"/>

however I am now using tiles so what I had hoped was to use a tiles
attribute to pass the key :

  <definition name=".home" extends=".baseDef">
        <put name="titleKey"  value="title.home" />
  </definition>

and then use the key in the tile like:

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

however, nothing I've tried has worked (including just trying the
fmt:message tag w/o using Tiles like :
<c:set var="titleKey" value="home.title"/>) . 

For some reason, the fmt:message tag refuses to accept expression values. 

Can anyone offer me a best practice on how to handle this? Or at least solve
my problem?


Vincent Fumo
System Development Specialist
ACS Municipal Services
Government Systems
609-823-6587
AIM : neodem2001


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






------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------

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

Reply via email to