You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raphaël di Cicco <ra...@atosorigin.com> on 2003/04/30 14:43:28 UTC

proper use of "nested" layouts in tiles

Hi,

my website is composed of a main layout that contains multiple JSP pages. I
want to use a layout inside a layout , to build my layout more precisely.
this is what I've done in my XML tiles def, redefine my body in detail  :

<tiles-definitions>
<definition name="page.resultats" path="layout/layout.jsp">
    <put name="title" value="Page title" />
    <put name="menu" value="layout/exemple_menu.jsp" />
    <put name="body" value="page.body" />
    <put name="header" value="/header.jsp" />
    <put name="footer" value="/piedDePage.jsp" />
</definition>
<definition name="page.body" path="layout/body1.jsp">
<put name="cell1" value="logon.jsp" />
<put name="cell2" value="includeRechArme.jsp" />
<put name="cell3" value="tableauBord.jsp" />
<put name="cell4" value="" />
</definition>
</tiles-definitions>

page.resultats uses the definition of page.body. This works great.
But when I want to overload page.body for cell1 for example I don't get the
result i want. This is what I've tried inside my JSP page that uses the
layout template :

<tiles:insert definition="page.resultats" flush="true">
    <tiles:put name="title" value="Custom title" />  //I change the title
    <tiles:insert definition="page.body">
        <tiles:put name="cell2" value="logon.jsp" /> // Now I want to change
a cell inside another tile
    </tiles:insert>
</tiles:insert>
But when I load the JSP page logon.jsp is displayed before my tiles and it
seems my changes haven't been taken into consideration. Is this possible by
any way ?


----- Original Message -----
From: "Andrew Hill" <an...@gridnode.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, April 30, 2003 12:29 PM
Subject: RE: test


> Nope. Never got it.
> Nothing to see here. Move along....
>
>
> -----Original Message-----
> From: AMIR-TAHMASSEB Marc [mailto:MAMIR-TAHMASSEB@cus-strasbourg.net]
> Sent: Wednesday, 30 April 2003 16:43
> To: struts-user@jakarta.apache.org
> Subject: test
>
>
> Does anybody receive this mail ?
>
> --
> Marc AMIR-TAHMASSEB
> mamir-tahmasseb@cus-strasbourg.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Re: proper use of "nested" layouts in tiles

Posted by Raphaël di Cicco <ra...@atosorigin.com>.
I have also tried this in my JSP page with no effect :

<tiles:definition id="page.body2" extends="page.body">

<tiles:put name="cell2" value="/logon.jsp" />

</tiles:definition>

<tiles:insert definition="page.resultats" flush="true">

<tiles:put name="title" value="Custom title" />

<tiles:put name="body" value="page.body2" />

</tiles:insert>


----- Original Message -----
From: "Raphaël di Cicco" <ra...@atosorigin.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, April 30, 2003 2:43 PM
Subject: proper use of "nested" layouts in tiles


> Hi,
>
> my website is composed of a main layout that contains multiple JSP pages.
I
> want to use a layout inside a layout , to build my layout more precisely.
> this is what I've done in my XML tiles def, redefine my body in detail  :
>
> <tiles-definitions>
> <definition name="page.resultats" path="layout/layout.jsp">
>     <put name="title" value="Page title" />
>     <put name="menu" value="layout/exemple_menu.jsp" />
>     <put name="body" value="page.body" />
>     <put name="header" value="/header.jsp" />
>     <put name="footer" value="/piedDePage.jsp" />
> </definition>
> <definition name="page.body" path="layout/body1.jsp">
> <put name="cell1" value="logon.jsp" />
> <put name="cell2" value="includeRechArme.jsp" />
> <put name="cell3" value="tableauBord.jsp" />
> <put name="cell4" value="" />
> </definition>
> </tiles-definitions>
>
> page.resultats uses the definition of page.body. This works great.
> But when I want to overload page.body for cell1 for example I don't get
the
> result i want. This is what I've tried inside my JSP page that uses the
> layout template :
>
> <tiles:insert definition="page.resultats" flush="true">
>     <tiles:put name="title" value="Custom title" />  file://I change the
title
>     <tiles:insert definition="page.body">
>         <tiles:put name="cell2" value="logon.jsp" /> // Now I want to
change
> a cell inside another tile
>     </tiles:insert>
> </tiles:insert>
> But when I load the JSP page logon.jsp is displayed before my tiles and it
> seems my changes haven't been taken into consideration. Is this possible
by
> any way ?
>



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