struts/bean question

Discussion in 'Java' started by Benjamin Stewart, Jul 2, 2003.

  1. 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
    Benjamin Stewart, Jul 2, 2003
    #1
    1. Advertising

  2. Benjamin Stewart

    Wendy S Guest

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

    --
    Wendy in Chandler, AZ
    Wendy S, Jul 3, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Benjamin Stewart

    To bean or not to bean...

    Benjamin Stewart, Jun 30, 2003, in forum: Java
    Replies:
    0
    Views:
    787
    Benjamin Stewart
    Jun 30, 2003
  2. David Thielen
    Replies:
    2
    Views:
    770
    Marek Lange
    Sep 12, 2003
  3. Markku Salminen
    Replies:
    3
    Views:
    5,833
    Michael Borgwardt
    Jan 21, 2004
  4. Thomas P. Fuller
    Replies:
    1
    Views:
    4,513
    bitbucket43
    Aug 17, 2004
  5. jill
    Replies:
    5
    Views:
    15,535
Loading...

Share This Page