Hi all,
I was wondering if there is a way to inherit the value of an attribute and to
extend it with new content. Basically, I’m looking for something like
inherit=”true” for list-attributes but for normal attributes.
Following is a quick example of what I would like to do:
Initialization in /WEB-INF/tiles-defs.xml:
<definition name=" test.definition" template="/layouts/classic.jsp">
<put-attribute name="title" value="Initial title value" />
</definition>
Inherit and extend in /test.jsp, note inherit=”true” in the <putAttribute> tag
(which does not work but I think it shows what I want to achieve):
<tiles:insertDefinition name="test.definition">
<tiles:putAttribute name="title" inherit=”true”>
--This text gets appended to the initial value of the title attribute
</tiles:putAttribute>
</tiles:insertDefinition>
Now, when inserting the attribute with the following code:
<tiles:insertAttribute name="title"/>
The following title should be displayed:
Initial title value--This text gets appended to the initial value of the title
attribute
Is there any way to achieve this with Tiles? Any help would be greatly
appreciated!
Thanks!
John