Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   struts/bean question (http://www.velocityreviews.com/forums/t123992-struts-bean-question.html)

Benjamin Stewart 07-02-2003 10:44 PM

struts/bean question
 
Greetings,
I have an application that is iterating through nested objects etc. The
guys that have developed the code that sits behind our struts
application has functions that take parameters. Am I able to pass a
parameter to a method from a <bean:write> or <bean:iterate> tag ?? I
have tried this, but it dont work

<logic:iterate id="stateMap" name="MajGroupList"
property="salesCurve(2004)">

^^^^^

If I cant pass parameters is there any other way around this without
having to rewrite the API?

Thanks
Ben


Wendy S 07-03-2003 01:34 AM

Re: struts/bean question
 
Benjamin Stewart wrote:

> Greetings,
> I have an application that is iterating through nested objects etc. The
> guys that have developed the code that sits behind our struts
> application has functions that take parameters. Am I able to pass a
> parameter to a method from a <bean:write> or <bean:iterate> tag ?? I
> have tried this, but it dont work
> <logic:iterate id="stateMap" name="MajGroupList"
> property="salesCurve(2004)">
> If I cant pass parameters is there any other way around this without
> having to rewrite the API?


Not to my knowledge. JSTL is usually the answer to the limitations of the
logic/bean tags, but the current version does not provide for calling
arbitrary methods and certainly not for passing parameters.

But you don't have to rewrite the underlying code... write a custom tag.
Take what you need from <logic:iterate> or <c:out> and extend it to do what
you need.

--
Wendy in Chandler, AZ


All times are GMT. The time now is 11:35 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.