indexed property for array does not see my bean :-(

Discussion in 'Java' started by milkyway, Dec 26, 2004.

  1. milkyway

    milkyway Guest

    Hello all,

    I have been attempting to use the Indexed Properties as defined in
    http://struts.apache.org/faqs/indexedprops.html

    I have been working on returning a list of objects to a .jsp.

    In other words, in the .jsp, I have something like:

    .....
    <bean:write name="bean" property="labelValue[1].label" />

    except, I have created my own class (with getters and setters) as well
    as an indexed property (that is part of an ActionForm servelet).

    My problem is as follows (I will use my code for now).
    When I do:

    <bean:write name="People" property="peopleValue[1].SocSecNo" /> then I
    get the following message:

    "org.apache.jasper.JasperException: No getter method for property
    peopleValue[1].SocSecNo"

    But for my class, I do have the getters and setters: getSocSecNo and
    setSocSecNo. If I just do the following:

    <bean:write name="People" property="peopleValue[1]"

    then I get the data but it looks something like:

    SocSecNo -> 123-45-6789 LastName -> Monster FirstName -> Herman
    Address -> 123 Sesame Street ...

    and I get *no exceptions*

    So, it seems like it recognizes my indexed property, it seems to
    recognize the data I have put in but it does not seem to recognize my
    bean (or see it as a bean).

    What must I do to make it see that I have an array of beans?
    What do I need to do to my own class (People) to make it a bean?

    I am using "Exadel Strut Studio" and have tried to make the regular
    class a bean by implementing it as an ActionForm (I thought a bean is a
    bean is a bean) but it still does not work.
    What can I do?

    Kindest Regards.

    PS - sorry to be so long.
     
    milkyway, Dec 26, 2004
    #1
    1. Advertising

  2. milkyway

    Ryan Stewart Guest

    "milkyway" <> wrote in message
    news:...
    [...]
    > <bean:write name="People" property="peopleValue[1].SocSecNo" /> then I
    > get the following message:
    >
    > "org.apache.jasper.JasperException: No getter method for property
    > peopleValue[1].SocSecNo"
    >
    > But for my class, I do have the getters and setters: getSocSecNo and
    > setSocSecNo. If I just do the following:
    >

    [...]
    <bean:write name="People" property="peopleValue[1].socSecNo" />
     
    Ryan Stewart, Dec 26, 2004
    #2
    1. Advertising

  3. milkyway

    Ryan Stewart Guest

    "milkyway" <> wrote in message
    news:...
    > Hello all,
    >

    [...]
    And please choose one group to post to. Stick with comp.lang.java.help for
    now. It is for simple issues. The .programmer group is for more advanced
    things.

    Followup set to c.l.j.h
     
    Ryan Stewart, Dec 26, 2004
    #3
    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:
    833
    Benjamin Stewart
    Jun 30, 2003
  2. jill
    Replies:
    5
    Views:
    15,884
  3. Replies:
    1
    Views:
    3,935
    Tim B
    Jan 7, 2006
  4. Steven T. Hatton

    To bean or not to bean

    Steven T. Hatton, Aug 28, 2004, in forum: C++
    Replies:
    61
    Views:
    1,413
    Steven T. Hatton
    Sep 10, 2004
  5. Myriam Abramson

    XML encoding of indexed property bean

    Myriam Abramson, Nov 26, 2007, in forum: Java
    Replies:
    0
    Views:
    325
    Myriam Abramson
    Nov 26, 2007
Loading...

Share This Page