2009/12/13 Xabier Burgos Gimeno <[email protected]>:
> <meta name="keywords" content="#foreach($keyword in
> $metaKeywords)$tiles.getAsString({"name":"$keyword"}),#end"/>
The $tiles.getAsString call, as all the methods in Tiles2Tool, has the
same meaning as the <tiles:getAsString> tag in JSP: it writes an
attribute as a string. It does not return a string.
In your case you have only one named attribute, "metaKeywords", that
is a list attribute. You have two options:
1) Using Tiles2Tool in a tag-style, using $tiles.importAttribute to
get the list attribute and then iterate this attribute and use:
$tiles.getAsString({"value": $myIteratedAttribute}
2) Using VelocityStyleTilesTool:
http://tiles.apache.org/framework/apidocs/org/apache/tiles/velocity/template/VelocityStyleTilesTool.html
this way:
#foreach($attribute in $tiles.getAttribute("metaKeywords").value)
$attribute.value ,
#end
(I am not completely sure about the syntax :-S )
HTH
Antonio