Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > indexed property for array does not see my bean :-(

Reply
Thread Tools

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

 
 
milkyway
Guest
Posts: n/a
 
      12-26-2004
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.

 
Reply With Quote
 
 
 
 
Ryan Stewart
Guest
Posts: n/a
 
      12-26-2004
"milkyway" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
[...]
> <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" />


 
Reply With Quote
 
 
 
 
Ryan Stewart
Guest
Posts: n/a
 
      12-26-2004
"milkyway" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML encoding of indexed property bean Myriam Abramson Java 0 11-26-2007 01:22 PM
struts indexed form elements not getting into form bean apaeth@fortdearborn.com Java 1 01-07-2006 09:29 PM
Struts - bean:write or html:text - not getting bean value - Please help jill Java 5 12-15-2005 03:03 PM
Mr. Bean Complete Bean NOT complete!! Waterperson77 DVD Video 5 12-10-2003 05:22 PM
To bean or not to bean... Benjamin Stewart Java 0 06-30-2003 12:34 AM



Advertisments