Tiles2 error with cascade attribute in put-attribute tag

I just don’t know why I get this error:

2010-10-28 16:32:29,925 ERROR [ache.commons.digester.Digester.error          :1635] - Parse Error at line 45 column 56: Attribute "cascade" must be declared for element type "put-attribute".
org.xml.sax.SAXParseException: Attribute "cascade" must be declared for element type "put-attribute".

tiles.xml looks something like this (only relevant parts):

<tiles-definitions>
<definition name="customerBaseLayout" template="/pages/customer/templates/baseLayout.jsp">
    <put-attribute name="title" value="Pannello Operatore"/>
    <put-attribute name="header" value="/pages/customer/templates/header.jsp"/>
    <put-attribute name="footer" value="/pages/customer/templates/footer.jsp"/>
</definition>
<definition name="userBaseLayout" extends="customerBaseLayout">
    <put-attribute name="header" value="/pages/guest/templates/user/header.jsp"/>

    <put-attribute name="sidebar" cascade="true" />
</definition>

I also tried to set the value attribute, but did not use it. I found cascading attr in the documentation here

I use netBeans 6.9 with struts 2.1 and tiles 2.0.6. The idea is not aware of the cascading attribute in the code hints.

+3
source share
3 answers

You are using Tiles 2.0.6, but the cascade is only in DTD 2.1.

+10
source

I think the problem arises because you are expanding the clientBaseLayout tile, and the tiles do not know if you want to use the default values ​​that you specified for this definition. For example, you put the title attribute, but since you did not set cascade = "true", it is not available in userBaseLayout. Add to the customerBaseLayout cascade = "true" the attributes that you want to use in userBaseLayout.

0
source

Source: https://habr.com/ru/post/1771934/


All Articles