1
votes

I have the following tile definitions

<definition name="homePage" extends="basetemplate">
 <put-attribute name="centeredContentSection" value="hometemplate"/>

<definition name="insidetemplate" templateExpression="/WEB-INF/jsp/templates/centercontentemplate.jsp">
    <put-attribute name="maincomponent" expression="/WEB-INF/jsp/tiles/resource.jsp"/>
    <put-attribute name="rightcomponent"  expression="/WEB-INF/jsp/tiles/right.jsp"/>
</definition>

<definition name="welcome" extends="basetemplate" >
    <put-attribute name="centeredContentSection" value="insidetemplate"/>
</definition>

<definition name="resourceListing" extends="welcome">
<put-attribute name="maincomponent" expression="/WEB-INF/jsp/tiles/resourcelist.jsp"/>
</definition>

In the resourceListing definition I specify a maincomponent attribute, which I think should override the one defined the insidetemplate definition which is a nested inside welcome defintion. However the value I have specify for maincomponent (/WEB-INF/jsp/tiles/resource.jsp) does not seem get overridden by the value I specify in resourceListing definition. Is there anyway to make this happpen?

1

1 Answers

0
votes

What you describe doesn't sound like correct behaviour.

Defintion.inherit(definition) should not be overriding attributes, see BasicAttributeContext.addMissing(..)

reference https://github.com/apache/tiles/blob/TILES_3_0_X/tiles-api/src/main/java/org/apache/tiles/BasicAttributeContext.java#L254