Question about Struts <logic:iterate> tag



I have an action class that creates an ArrayList of Foo objects and
then sets them in the request. Note I am putting the list itself
directly into the request:

FooAction.java:
List fooList = new ArrayList();
for (int i = 0; i < 3; i++)
{
String id = "ID" + i;
Foo f = new Foo(id);
fooList.add(f);
}
request.setAttribute("foos", fooList);
// forward to JSP for display


In my JSP, I want to iterate over and display the Foo objects and
display their IDs.

I have:
<logic:iterate id="nextElement" name="foos">
<br>NextFoo<bean:write name="nextElement" property="id" /></b>
</logic:iterate>

However, I get the error:
Cannot find bean nextElement in any scope'

What am I doing wrong?
Thanks in advance.

.



Relevant Pages

  • Re: Question about Struts tag
    ... > // forward to JSP for display ... I want to iterate over and display the Foo objects and ... 'Foo' class has a good 'toString' method. ...
    (comp.lang.java.programmer)
  • Re: Question about Struts tag
    ... The jsp has to know where to access the bean. ... >I have an action class that creates an ArrayList of Foo objects and ... > // forward to JSP for display ...
    (comp.lang.java.programmer)
  • Re: Passing checkbox values from one JSP page to another
    ... boolean as if selected we get true then if checkbox is true then add ... it to request as attribute and display them in another jsp. ... Use a controller servlet to decipher the request parms, then dispatch to the destination JSP with values predefined, say via request.setAttribute. ...
    (comp.lang.java.programmer)
  • Re: Struts question
    ... jsp displays again. ... I didn't say a form is submitted before you display a JSP... ... *request* must go through an Action. ... If, instead, you 'hide' that JSP, and make the browser go to ...
    (comp.lang.java.programmer)
  • Re: Servlet to JSP problem
    ... do is pass the arraylist to a JSP and display the values in the ... It tries to get a string from the request not the arraylist. ... JSP or you will have to serialize it somehow before putting it on the ... Bear in mind that GET has a maximum allowed length. ...
    (comp.lang.java.programmer)