On Tue, Oct 13, 2009 at 3:52 PM, Antonio Petrelli
<[email protected]> wrote:
> 2009/10/13 Johannes Kuhs <[email protected]>
>
>> The following content should be inserted:
>> <div>This is the initial content</div>
>> <div>This text gets appended to the initial content of the body
>> attribute</div>
>> ...
>> In your opinion, what would be the best way to achieve this? Also,
>> what do you think about the idea of adding an "inherit" attribute for
>> the "putAttribute" tag? The same functionality already exists for
>> lists so I think it would make sense to have it for normal attributes
>> as well, wouldn't it?
>>
>
> I think that lists inheritance is great in this sense.
>
> In your templates put this:
>
> <tiles:importAttribute name="myList" />
> <c:forEach var="attribute" items="${myList}">
>  <tiles:insertAttribute value="${attribute}" />
> </c:forEach>
>
> And create in your Tiles definitions a base list attribute and an extended
> one.
>
> HTH
> Antonio
>

Yes, the lists inheritance is great and using it would definitely
work. However, I would need to implement lists for all attributes in
order to keep the application flexible enough to handle inheritance
when needed without having to make changes to the Tiles definition. I
was hoping for a more elegant solution that somehow works with normal
(non-list) attributes.

Reply via email to