File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Pulling my hair out over this one! Indexing issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic

Pulling my hair out over this one! Indexing issue

mr Cranberry

Joined: Jul 18, 2007
Posts: 5
OK this is driving me crazy and I'm about to give up...

I'm trying very hard to use the "indexed='true'" feature of struts to manage a very simple ArrayList of objects in a page. It displays just fin, and I've checked the html code and it's populating the indexed properties just fine. But, when I post the form to an action, the constructor on the form gets called just fine but what I can NOT seem to get to happen correctly, is the part where Struts uses reflection to populated the list with the data on the html page. I just don't get why that part isn't happening... any ideas?

Config excerpt:

<action path="/VehicleDisplay"
<forward name="success" path="vehicle.maintenanceThirdParty"/>

<action path="/SaveVehicleInfo"
<forward name="success" path="vehicle.maintenanceThirdParty"/>
<forward name="stay" path="/"/>
<forward nam


public class VehicleMaintenanceForm extends ValidatorForm {

private List vehicleList;

public VehicleMaintenanceForm() {
vehicleList=new ArrayList(4);
for (int i=0; i<4; i++) {
vehicleList.add( new TagDTO());

public List getVehicleList() {
return vehicleList;

public void setVehicleList(List vehicleList) {
this.vehicleList = vehicleList;


Jsp excerpt:

<html:form action="/SaveVehicleInfo">

<logic:iterate name="VehicleMaintenanceForm" property="vehicleList" id="lineItem" indexId="rowNum">
<tr class="oddd">

<td align="center">
<html:text name="lineItem" indexed="true" property="licPlate"/>


A breakpoint and trace thru the action "SaveVehicleInfo" confirms that the list is empty and was never populated by the framework...

Any ideas anyone?? What piece am I missing here? Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Mr Cranberry,

There are a couple of housekeeping issues I need to bring up with you.

The first is that it's considered bad form to post the same question in more than one thread as you have done. Please post the question to only one forum and one thread. Otherwise, it wastes the time of those willing to respond.

The second issue is the name you have displayed. The name you are currently displaying does not meet the guidelines of the JavaRanch Naming Policy. In particular, the name you display must be a first and last name, and must not be obviously fictitious. Please change the Publicly Displayed Name in your user profile so that it meets the guidelines.

This may seem trivial to you, but it's an important part of the culture at JavaRanch, and we do appreciate your compliance with it.

I'm closing this tread because it's a duplicate. Anyone wishing to respond, please do so in this thread.
[ July 18, 2007: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: Pulling my hair out over this one! Indexing issue
It's not a secret anymore!