struts/bean question

  • Thread starter Benjamin Stewart
  • Start date
B

Benjamin Stewart

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
 
W

Wendy S

Benjamin said:
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:eek:ut> and extend it to do what
you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top