Hi
  I've classic layout structure with header, menu, body and footer.

There is an abstract definition named "default", that does not have "body" attribute set.

<definition name="default" template="/WEB-INF/layouts/default.jspx">

    <put-attribute name="header" value="/WEB-INF/views/publicHeader.jspx" />

    <put-attribute name="menu" value="/WEB-INF/views/menu.jspx" />

    <put-attribute name="footer" value="/WEB-INF/views/footer.jspx" />

</definition>


There are several pages, that have similar body, so I'd like to extend "default" definition and create new one. This new abstract definition (called "account") would be later on reused to create several pages.

account.jspx contains

...

  <tiles:importAttribute name="account_details"/>

...

and I've the following two definitions

<definition name="account" extends="default">
        <put-attribute name="body" value="/WEB-INF/views/account/account.jspx" 
/>
</definition>

<definition name="account/buy" extends="account">
        <put-attribute name="account_details" 
value="/WEB-INF/views/account/buy.jspx"/>
</definition>


Unfortunately this ends up with
org.apache.tiles.template.NoSuchAttributeException: Attribute 'account_details' not found. at org.apache.tiles.template.DefaultAttributeResolver.computeAttribute(DefaultAttributeResolver.java:49)
...
at org.apache.jsp.WEB_002dINF.views.account.account_jspx._jspx_meth_tiles_005finsertAttribute_005f0(account_jspx.java:438) at org.apache.jsp.WEB_002dINF.views.account.account_jspx._jspService(account_jspx.java:117)

What am I doing wrong ?

Thanks

Lukas

Reply via email to