Re: problem with logic:iterate in struts
From: Murray (parps_at_SPAMOFFoptusnet.SPAMMAGE.com.au)
Date: 07/31/04
- Next message: David Hilsee: "Re: problem with logic:iterate in struts"
- Previous message: Brandon J. Van Every: "Re: Your Guru Paul Graham is getting trashed on Slashdot."
- Next in thread: David Hilsee: "Re: problem with logic:iterate in struts"
- Maybe reply: David Hilsee: "Re: problem with logic:iterate in struts"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 31 Jul 2004 14:47:47 +1000
"Arun Nair" <arun282002@yahoo.com> wrote in message
news:b05ff1a3.0407302014.44168955@posting.google.com...
> <td colspan="0" align="center">
> <logic:iterate id="year" name="years">
> <bean:write name="year" property="name"/>
> </logic:iterate>
> </td>
You're confusing the name and property attributes. Name should be the bean
that contains the collection i.e. "jeb" and property is the property of that
bean which respresents the collection i.e. "years"
<logic:iterate id="year" name="jeb" property="years">
<bean:write name="year" property="name"/>
</logic:iterate>
However I think you're going to have other problems going by the source code
you gave
public Object getYears(int index) {
return years.get(index);
}
This isn't a bean method: getter methods don't have arguments. getYears
shouild probably just return the list, not a particular entry in the list
(I'm guessing here, since I don't know your intentions)
- Next message: David Hilsee: "Re: problem with logic:iterate in struts"
- Previous message: Brandon J. Van Every: "Re: Your Guru Paul Graham is getting trashed on Slashdot."
- Next in thread: David Hilsee: "Re: problem with logic:iterate in struts"
- Maybe reply: David Hilsee: "Re: problem with logic:iterate in struts"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|