Spot On! Thanks very much.

Far too much RTFM for me to do obviously.

Howard

-----Original Message-----
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: 27 August 2002 16:08
To: Struts Users Mailing List
Subject: RE: Iterate: No getter method problem


Try using

<logic:iterate id="....." name="mybean" property="list">

Note that the property value is 'list' and not 'List'.  Unless instructed
otherwise, per JavaBeans spec, this'll result in a call to 'getList' (now
with an uppercase 'l') -- just like your method is named.


Sri

-----Original Message-----
From: Howard Miller [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, August 27, 2002 11:05 AM
To: '[EMAIL PROTECTED]'
Subject: Iterate: No getter method problem


Hi,

I simply cannot get the <logic:iterate> tag to work. All I get is a "no
getter method for...." error message, when there IS a getter method in the
bean. 

Worse still I don't understand the documentation. Please excuse me copying a
chunk, but to be clear:

>From the UserGuide....
example: 
<%
    java.util.ArrayList list = new java.util.ArrayList();
    list.add("First");
    list.add("Second");
    list.add("Third");
    list.add("Fourth");
    list.add("Fifth");
    pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE); %>

<logic:iterate id="myCollectionElement" name="list">
  Do something with myCollectionElement
</logic:iterate>

...to my mind, what is being added to the pagecontext is not a bean its the
list! so name="list" refers not to a been but to an instance of an ArrayList
object. I don't get this at all, can somebody help me out?

My tag looks like:

<logic:iterate id="....." name="mybean" property="List"> etc.

in the bean (which it finds, because when I had the name wrong I got a
"can't find bean in any scope message", I simply have

public ArrayList getList() {
  return (this.List)
  }

for the record the ArrayList just contains String objects.   I've been
staring at this for around 24 hours and I am completely stuck. Any help
appreciated.

Howard

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to