tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier THIERRY <olivier.thie...@gmail.com>
Subject How to use a template attribue in nested templates with Tiles 2.0.7 ?
Date Thu, 27 Aug 2009 09:31:47 GMT
Hi,

I am a newbie with Tiles and I encounter a problem with Tiles 2.0.7.

I have the following definition.

    <definition name="general" template="/WEB-INF/templates/general.jsp">
        <put-attribute name="title" value="My application"/>
        <put-attribute name="header" value="/WEB-INF/jsp/common/header.jsp" />
        <put-attribute name="content" value=""/>
        <put-attribute name="footer" value="/WEB-INF/jsp/common/footer.jsp"/>
    </definition>

I need to use "title" attribute in both "general.jsp" and "header.jsp"
templates this way :

<tiles:getAsString name="title" />

No problem with "general.jsp". But it doesn't work in "header.jsp" :
it tells the "title" attribute is unknown.
For what I understood, template attributes are not propagated to
nested templates. And it sounds quite logical to me.

I use Tiles with Spring 2.5.6. I saw that there is a "cascade"
attribute from Tiles 2.1 that could solve my problem.
But Tiles 2.1.x is not compatible with Spring 2.5.6 and I can't
upgrade Spring ...

Anyone has an idea how I could make this with Tiles 2.0.7 ?

Thanks in advance for any help

Olivier

Mime
View raw message