tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Petrelli" <antonio.petre...@gmail.com>
Subject Re: attribute not found on second page
Date Mon, 04 Jun 2007 08:34:48 GMT
2007/6/4, Gert Vanthienen <gert.vanthienen@skynet.be>:
> I have created a tiles.xml file to define (see below)
> - template.webshop, which insert a two-column body (navigation and
> content) in a JSP page
> - webshop.home uses template.webshop and fills in the navigation and
> content attributes
>
> However, Tiles complains about "Attribute 'content' not found" when
> showing the webshop.home definition.  Why?  Can't you insert a page
> which contains <tiles:insertAttribute /> tags itself?

JSP pages used in attribute are never used as templates! Probably you
wanted to fill "navigation" and "content" attributes of
"two_column_body.jsp" and not of "basic.jsp".

>     <definition name="template.webshop" templates="/templates/basic.jsp">
>         <put-attribute name="header"
> value="/templates/shopping_header.jsp"/>
>         <put-attribute name="body" value="/templates/two_column_body.jsp"/>
>     </definition>
>
>     <definition name="webshop.home" extends="template.webshop">
>         <put-attribute name="navigation"
> value="/templates/navigation_collapsed.jsp"/>
>         <put-attribute name="content" value="/home.jsp" />
>     </definition>

Change it this way:

     <definition name="template.webshop" templates="/templates/basic.jsp">
         <put-attribute name="header"
 value="/templates/shopping_header.jsp"/>
     </definition>

     <definition name="webshop.home.body"
templates="/templates/two_column_body.jsp">
         <put-attribute name="navigation"
value="/templates/navigation_collapsed.jsp"/>
         <put-attribute name="content" value="/home.jsp" />
     </definition>

     <definition name="webshop.home" extends="template.webshop">
         <put-attribute name="body"
 value="webshop.home.body"/>
     </definition>

HTH
Antonio

Mime
View raw message