3

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 did try setting the value attribute too but no use. The cascade attr I found in the documentation here

I am using netBeans 6.9 with struts 2.1 and tiles 2.0.6 The ide does not know about the cascade attribute in code hints.

Psyconn
  • 127
  • 3
  • 8

3 Answers3

10

You're using Tiles 2.0.6 but "cascade" is only in the 2.1 DTD.

7

Same issue here. I specify the dtd locatation as http://tiles.apache.org/dtds/tiles-config_2_1.dtd. My IDE correctly recognizes it and allows the cascade attribute. But once it's run, the same error message is displayed.

Georgie Porgie
  • 2,100
  • 3
  • 24
  • 25
  • 11
    I got it figured out. The complete doctype should be:` ` Previously, although I pointed dtd to tiles-config_2_1.dtd, I still used definition as `"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"`. Hope it helps people who are running into this problem. – Georgie Porgie Jul 06 '11 at 18:52
0

I think the problem comes because you extend the tile customerBaseLayout and tiles doesn't know if you want to use as default the values you put for this definition. For example you have put title attribute but as you haven't set cascade="true" it is not available in userBaseLayout. Add in customerBaseLayout cascade="true" to the attributes you want to have in userBaseLayout.

Javi
  • 19,387
  • 30
  • 102
  • 135
  • Doesn't work. It's not about the place where cascade is used, it's about the xml parser being absolutely sure cascade should not be in that tag, but in the version of the tag from a parallel universe. – Psyconn Nov 01 '10 at 08:30