Re: problem with logic:iterate in struts

From: Murray (parps_at_SPAMOFFoptusnet.SPAMMAGE.com.au)
Date: 07/31/04


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)



Relevant Pages

  • Re: JSTL example
    ... little bit confusing for me. ... points to the String "bean", to whit, the value set from the parameter by the. ...
    (comp.lang.java.help)
  • Re: Adam Wade, Man or Myth?
    ... You're confusing him with Bean, ... Beav ... Reply to "beavis dot original at ntlworld dot com" (with the obvious ...
    (rec.motorcycles)