For Programmers: Free Programming Magazines  


Home > Archive > Java Help > December 2004 > indexed property for array does not see my bean :-(









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

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

2004-12-26, 3:56 pm

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.

Ryan Stewart

2004-12-26, 3:56 pm

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1104071386.512490.301010@z14g2000cwz.googlegroups.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" />


Ryan Stewart

2004-12-26, 3:56 pm

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1104071386.512490.301010@z14g2000cwz.googlegroups.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


milkyway

2004-12-26, 3:56 pm

Hello there,

Thanks for the hint.

BTW, since my problem is very simple, would you happen to have an
answer?

Regards.

Ryan Stewart

2004-12-26, 3:56 pm

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1104076753.879037.31160@f14g2000cwb.googlegroups.com...
> Hello there,
>
> Thanks for the hint.
>
> BTW, since my problem is very simple, would you happen to have an
> answer?
>
> Regards.
>

Did you not see my other post? If not, I've included it in its entirety:

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1104071386.512490.301010@z14g2000cwz.googlegroups.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" />


milkyway

2004-12-27, 8:56 am

Hello out there,

Has anyone ever encountered this problem? If so, what did you do to get
around it?

Kindest Regards.

Ryan Stewart wrote:
> "milkyway" <d0mufasa@hotmail.com> wrote in message
> news:1104076753.879037.31160@f14g2000cwb.googlegroups.com...
> Did you not see my other post? If not, I've included it in its

entirety:
>
> "milkyway" <d0mufasa@hotmail.com> wrote in message
> news:1104071386.512490.301010@z14g2000cwz.googlegroups.com...
> [...]
then I[color=darkred]
and[color=darkred]
> [...]
> <bean:write name="People" property="peopleValue[1].socSecNo" />


Ryan Stewart

2004-12-27, 8:57 pm

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1104136812.954123.62340@z14g2000cwz.googlegroups.com...
> Hello out there,
>

Hello in there!

> Has anyone ever encountered this problem? If so, what did you do to get
> around it?
>

I've answered your question twice now!

Since you seem to have missed it both times, I'm going to remove everything
else and leave only my answer below this line:

<bean:write name="People" property="peopleValue[1].socSecNo" />


ge0rge

2004-12-27, 8:57 pm

"Ryan Stewart" <zzanNOtozz@gSPAMo.com> wrote ...
> I've answered your question twice now!
>
> Since you seem to have missed it both times, I'm going to remove

everything
> else and leave only my answer below this line:
>
> <bean:write name="People" property="peopleValue[1].socSecNo" />


....and he'd probably miss it again!
Hint to the OP, read the line letter by letter and when you hear youself
swear, you have the solution.

--
"I went into a general store, and they wouldn't sell me anything specific".
-- Steven Wright


milkyway

2004-12-29, 3:58 am

If you are hinting that I have a syntax error, then please understand
that this was just a typo (i.e. copying it from the screen of 1
computer to another) on my part. I do have:

<bean:write name="People" property="peopleValue[1].SocSecNo" />

already and ever since I started this thread - but - I went ahead and
tried a *different* property. When doing this, I got data back for
which I am happy ;-))) I guess it was working all along.

So - there is just something wrong with the SocSecNo property I have
chosen - back to work now...

ge0rge wrote:
> "Ryan Stewart" <zzanNOtozz@gSPAMo.com> wrote ...
>
> ...and he'd probably miss it again!
> Hint to the OP, read the line letter by letter and when you hear

youself
> swear, you have the solution.
>
> --
> "I went into a general store, and they wouldn't sell me anything

specific".
> -- Steven Wright


Ryan Stewart

2004-12-29, 3:58 am

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1104297506.874051.298400@f14g2000cwb.googlegroups.com...
> If you are hinting that I have a syntax error, then please understand
> that this was just a typo (i.e. copying it from the screen of 1
> computer to another) on my part. I do have:
>
> <bean:write name="People" property="peopleValue[1].SocSecNo" />
>
> already and ever since I started this thread - but - I went ahead and
> tried a *different* property. When doing this, I got data back for
> which I am happy ;-))) I guess it was working all along.
>
> So - there is just something wrong with the SocSecNo property I have
> chosen - back to work now...
>

I don't believe this. ge0rge, just shoot me now!

Okay, look. This is what you have:
<bean:write name="People" property="peopleValue[1].SocSecNo" />

This is what I wrote:
<bean:write name="People" property="peopleValue[1].socSecNo" />

Look at the twelfth character from the end. In yours it's 'S'. In mine, it's
's'.

Java is case sensitive.

If I had a stick long enough, I'd whack you on the head with it.


Andrew Thompson

2004-12-29, 3:58 am

On Tue, 28 Dec 2004 23:48:13 -0600, Ryan Stewart wrote:

> If I had a stick long enough, I'd whack you on the head with it.


LOL! Now, Ryan.. this *is* c.l.j.help. ;-)

To the OP, copying from 'one screen to the other' is
a waste of your time and those that try to help you.
Find *some* way to copy/paste.

You can transport information between boxes using..
- Floppy disk
- Cable to cable connection
- Zip disk
- CD (permanent or rewriteable, they are getting fairly cheap)
- DVD
- Thumb drive
- Dragging the files onto a camera memory (or similar)
- Ethernet
...and, if both are internetted..
- Email
- FTP/HTTP..

Surely amongst the vast array of possibilities, you can
find some way to directly transfer files between boxes without
having to retype them. We *have* the technology(/ies).

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
milkyway

2004-12-29, 3:59 pm

I currently am working with 2 laptops and they are not networked (no
FTPing or NFS mounting possible now). One system is older with Windows
NT the other with Linux. At the time, did not feel like trying to make
the Linux CD writing feature actually work. Besides, if you just said
'typo error' instead of attempting to drop "hints", things would have
gone slightly faster.

Even though that was not the issue, as mentioned above, it *did* allow
me to rethink to use another possibility. Just new to all of this and
am not sure what actually works (as advertised) and what does not.
Peace..

milkyway

2004-12-29, 4:00 pm

Also, I currently am living in a foreign country. I just attempted to
apply a Windows NT upgrade where the screens are all written in :
German. Also bought a printer and had an interesting time as (of
course) instructions, etc. are in German. Have to wait until packages
arrive in order to do any type of networking.

Andrew Thompson

2004-12-29, 4:00 pm

On 29 Dec 2004 07:55:59 -0800, milkyway wrote:

> I currently am working with 2 laptops and they are not networked (no
> FTPing or NFS mounting possible now). One system is older with Windows
> NT the other with Linux.


Floppy disk with plain text files should do it then. Solved.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Andrew Thompson

2004-12-29, 4:00 pm

On 29 Dec 2004 07:59:26 -0800, milkyway wrote:

> Also, I currently am living in a foreign country.


So, you're ..*not* an aussie? [ ;-) ]

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
milkyway

2004-12-29, 8:58 pm

No - I am an American ;-) (oder auf Deutsch Amerikanerin)

New laptop does not have floppy disk - just a CD. Next time, will just
spend the time to figue out how to get things to CD....

Andrew Thompson wrote:
> On 29 Dec 2004 07:55:59 -0800, milkyway wrote:
>
(no[color=darkred]
Windows[color=darkred]
>
> Floppy disk with plain text files should do it then. Solved.
>
> --
> Andrew Thompson
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.PhySci.org/ Open-source software suite
> http://www.1point1C.org/ Science & Technology
> http://www.LensEscapes.com/ Images that escape the mundane


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com