struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <...@Germuska.com>
Subject RE: Tiles with javascript heavy pages
Date Thu, 20 May 2004 15:25:06 GMT
>Do you know if you can embed the <tiles:getAsString /> inside the 
><bean:message>
>to have the tiles attribute define the key for the bundle?

You can never embed any JSP tag inside another JSP tag.

You could use <bean:define> or <c:set> to create a page scoped 
variable using tiles:getAsString and then use it for the key to 
bean:message...

<c:set var="thekey"><tiles:getAsString name="titleKey" /></c:set>
<bean:message key="${thekey}" />

This is assuming you're using the JSTL and struts-el, which is highly 
recommended if you are on a Servlet 2.3/JSP 1.2 container (including 
Tomcat 4 among others).

Otherwise, it would look more like
<bean:define name="thekey"><tiles:getAsString name="titleKey" /></bean:define>
<bean:message key="<%= thekey %>" />

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
       "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
             -- Jef Raskin

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message