struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <D...@Newfield.org>
Subject Re: [struts] parameter to custom tag
Date Wed, 27 Feb 2008 18:59:23 GMT
Kropp, Henning wrote:
> I figured it out. I used <s:set/ > for this. Thanks.
> 
> <s:iterator value="model.list">
>    <s:set name="value">
>        <s:property />
>    </s:set>
>    <custom:tag attr="${value}" />                 </s:iterator>

That will only work if the value you're trying to pass is a string.
It might also add whitespace to either end of that value (due to the 
whitespace inside your s:set tag.

Why not pass the OGNL expression to your tag as a string and evaluate it 
inside your custom tag, instead?  If you use this custom tag in many 
places, I predict the extra jsp required to pre-evaluate the 
OGNL->string will be error-prone...

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message