struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim D Elcott" <telc...@yahoo.co.uk>
Subject Re: <bean:message> in a <tiles:insert>
Date Mon, 29 Apr 2002 04:59:40 GMT
Hi there,

Had this problem before and as a quick work around found that the tile
defintion below worked nicely. Just pass the key to your title as a string
in the tiles definiton and then use a 'hack' to load the text for the key in
your JSP.

So....

    <definition name="doc.mainLayout"
path="/jsps/layouts/classicLayout.jsp">
        <put name="title" value="home.title"/><!-- key -->
        <put name="header" value="/jsps/common/header.jsp"/>
        <put name="footer" value="/jsps/common/footer.jsp"/>
        <put name="body" value="doc.portal.body"/>
    </definition>

and in my JSP used

<tiles:useAttribute id="titleKey" name="title"/>
<title><bean:message name="titleKey" scope="page"/></title>

Works a treat!

Hope this help

Tim Elcott.

----- Original Message -----
From: "ajTreece" <aj.treece@sun.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Sunday, April 28, 2002 11:51 AM
Subject: <bean:message> in a <tiles:insert>


> Folks...
>
> I've set up some tiles code that allows me to utilize a common look and
feel to
> a table. The tiles code needs two pieces of data to build the table. Here
is an
> example:
>
> <tiles:insert definition="small.green.box.layout" flush="true">
>      <tiles:put name="title" value="/home/rasLinksHeader.jsp" />
>      <tiles:put name="body" value="/home/rasLinks.jsp" />
> </tiles:insert>
>
> It is required that the "title" value be extracted form the messages
resource
> bundle with  the <bean:message key="xxx"/> tag. My challenge is the only
way I
> can get it to work is if the "title" value points to a jsp who's only
action is
> to execute the <bean:message .../> tag. How do I utilize the
<bean:message> tag
> inside the <tiles:insert> block?
>
> I can handle the flames if this is obvious and I just can't see it....
>
> Thanks, ajTreece
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


Mime
View raw message