This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts Iterator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Iterator" Watch "Struts Iterator" New topic

Struts Iterator

Matt Connors

Joined: Sep 08, 2004
Posts: 23
I'm using an iterator to display a collection of objects. The data gets displayed correctly but when the user modifies the data that modification is not reflected in the Collection when it reaches the ActionObject. In other words the data gets mapped to the JSP fields correctly but the data does not seem to be getting mapped from the JSP field back to the Collection correctly.

Can someone tell me if I'm using incorrect syntax in my iterate statement? Is there some other problem here?



<logic:iterate id="msrf" name="MSReportForm"
<td align="left"><font size="1">
<bean:write name="msrf" property="departmentDesc"/></font>
<td align="center"><html:text name="msrf"
property="performance" size="16"
<td align="center"><html:text name="msrf"
property="churn" size="16"


public class MSReportForm extends ActionForm
private Collection departments = new ArrayList();


public class MSReportFormHelper {

private String departmentDesc;
private String performance;
private String churn;
Sujatha Kumar
Ranch Hand

Joined: Jan 05, 2004
Posts: 134
Hi Matt,

I feel that your Jsp is not getting submitted properly.
Just put some alert messages in the onSubmit function
and see whether the form is getting submitted.

I hope this would solve your problem.

[ November 23, 2004: Message edited by: Sujatha Kumar ]

Matt Connors

Joined: Sep 08, 2004
Posts: 23
The form is definitely getting submitted. In the Form Bean's validate method I had to resort to "manually" moving the data from the HTTP Request object to the Form Bean's attributes. Any other ideas?
I agree. Here's the link:
subject: Struts Iterator
It's not a secret anymore!