tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas LE BAS <m...@nlebas.net>
Subject Re: How to include a SimpleMenuItem bean in tiles:addAttribute in struts2
Date Fri, 30 Jan 2009 08:55:02 GMT
As per JSP syntax, you can't use a tag inside a tag attribute (even if 
struts 1 allows it). You could try with EL (something like <s:bean 
id="xyz" ...></s:bean><s:set scope="page" name="abc" 
value="#xyz"/><tiles:addAttribute value="${abc}"/>).

But IMHO it won't work: <tiles:addAttribute> can only add strings, 
definitions or templates.

AFAIK, you can't define menus using taglibs in the current version of 
tiles 2. You have to use tiles-def.xml for that.

Hope this helps

Ignacio de Córdoba a écrit :
> Hi there,
> I am trying to migrate my EL to struts2 tags and so I am trying to:
> 	<tiles:putListAttribute name="breadcrums">
> 		<s:bean name="org.apache.tiles.beans.SimpleMenuItem"> 
> 			<s:param name="link" value=""/> 
> 			<s:param name="value" value="#{folderName}" />
> 			<c:set var="test" value=""/>
> 			<tiles:addAttribute value="<s:property/>"/> 	
> 		</s:bean>
> 	</tiles:putListAttribute>
> But <s:property/> is added to the List Attribute as a string, not as the
> property it should be (the ValueStack property defined in s:bean.
> With other orientations I have a similar problem... how can I include a Bean
> defined with s:bean in the tiles:addAttribute value field?
> It's being hard to abandon EL and I wouldn't like to revert to it for this.
> thanks for any ideas,
> Ignacio

View raw message