I am working on a project using Apache Tiles 2.1 .
I have a problem when expanding templates with list attributes creates duplicates of these list items ... one set of duplicates for each level of inheritance.
As an example, here is a basic definition and the page that it will produce:
<definition name="base" template="somePage.jsp">
<put-list-attribute name="styles">
<add-attribute value="base.css"/>
</put-list-attribute>
</definition>
This will create html as expected:
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/base.css"/>
</head>
<body>
</body>
</html>
If I decipher the definition as follows:
<definition name="firstExtension" extends="base">
<put-list-attribute name="styles" inherit="true">
<add-attribute value="someOther.css"/>
</put-list-attribute>
</definition>
Again, as expected, I get this result:
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/base.css"/>
<link rel="stylesheet" type="text/css" href="../css/someOther.css"/>
</head>
<body>
</body>
</html>
However, if I continue the previous one, the problems will start:
<definition name="secondExtension" extends="firstExtension">
<put-list-attribute name="styles" inherit="true">
<add-attribute value="evenMore.css"/>
</put-list-attribute>
</definition>
This second level extension gives the following:
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/base.css"/>
<link rel="stylesheet" type="text/css" href="../css/base.css"/>
<link rel="stylesheet" type="text/css" href="../css/someOther.css"/>
<link rel="stylesheet" type="text/css" href="../css/evenMore.css"/>
</head>
<body>
</body>
</html>
"" , , , .
, 4-5 . , " " css 4-5 , "" , css.
, , ? - , inherit="true"? "" css javascript , .