tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <antonio.petre...@gmail.com>
Subject Re: ViewPreparers and InsertAttributeTag
Date Mon, 14 Jun 2010 12:12:54 GMT
2010/6/14 Jamie Cockrill <jamie.cockrill@gmail.com>:
>         attributeContext.putAttribute(
>             "my.attribute.name",
>             new Attribute("This is the value added by the ViewPreparer"));
>...
> <tiles:insertAttribute value="${some EL which returns
> 'my.attribute.name'}" flush="true" />
>
> When I attempt to render the page, I receive a stack trace with the
> following root cause:
>
> java.lang.ClassCastException: java.lang.String cannot be cast to
> org.apache.tiles.Attribute

>From the docs:

http://tiles.apache.org/framework/tiles-jsp/tlddoc/tiles/insertAttribute.html
name: Name of the attribute to insert. This attribute will be ignored
if the value attribute is specified.
value: Attribute object to render directly. If it specified, the name
attribute will be ignored.

Thus, use "name".

Antonio

P.S. Where's the JIRA issue?

Mime
View raw message