struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: [S2] getting property value / OGNL calling a method of my model object with an argument
Date Wed, 27 May 2009 23:01:46 GMT
Bas Schulte wrote:
>         <s:iterator value="categories">
>             <s:property value="description.title"/><br />
>             Activity id: <s:property value="activityId"/><br />
>             String: <s:property value="boomerang(activityId)"/><br />
>             No arg: <s:property value="boomerang"/><br /><br />
>         </s:iterator>
> 
> According to the OGNL docs, adding an argument needs parenthesis, as I'm 
> doing in 'boomering(activityId'. [sic]
> 
> This isn't working :( 'boomerang' without argument does work, it's 
> returning a string like it should. getBoomerang(Long l) nor 
> getBoomerang(String s) works. They're never called by Struts/ognl.
> 
> What am I missing? Is this supposed to work or not?

Passing in an argument means it's no longer a simple getter, so you have 
to actually call the method. Only real JavaBean getters work without the 
"get" prefix.

<s:property value="%{getBoomerang(activityId)}" />

Dave

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


Mime
View raw message