struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fumo, Vince" <Vince.F...@acs-inc.com>
Subject using <fmt:message> with Tiles and Struts
Date Fri, 25 Mar 2005 19:10:57 GMT
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message