J
javadude
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.
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.