tilesapache-tilestiles-3

Cannot override attribute in extended definition


After upgrading from Tiles 2 to Tiles 3, it seems overriding attributes stopped working.

My tiles.xml has something like this where create-form extends from baseLayout. I'm getting null for the "title" attribute (but the other attributes "menu", "left", "body" are all overridden correctly). Why doesn't this work anymore for "title"? Is "title" now a reserved word?

<definition name="baseLayout" template="/WEB-INF/layout/wireframe.jsp">
    <put-attribute name="title" value="" />
    <put-attribute name="menu" value="/WEB-INF/layout/menu.jsp" />
    <put-attribute name="left" value="/WEB-INF/layout/left.jsp" />
    <put-attribute name="body" value="/WEB-INF/layout/body.jsp" />
</definition>

<definition name="create-form" extends="baseLayout">
    <put-attribute name="title">Create New Item</put-attribute>
    <put-attribute name="menu" value="/WEB-INF/jsp/forms/create-menu.jsp" />
    <put-attribute name="left" value="/WEB-INF/jsp/forms/create-leftNavBar.jsp" />
    <put-attribute name="body" value="/WEB-INF/jsp/forms/create-body.jsp" />
</definition>

Solution

  • This solved my problem. I don't know why overriding an attribute in Tiles 3 only worked using the value attribute (not using the body of the <put-attribute> tag).

    <put-attribute name="title" value="Create New Item" />