I've got a problem relating to the validation of indexed properties in
Struts 1.1
I get the following error message when I try to access an ArrayList of Student objects in my DynaValidatorForm
Here is some background to the problem...
In my session I have an ArrayList called studentsList of objects of type experiment.mybeans.Student. A Student object has getter and setter methods for id, year and gradeAverage.
In my students.jsp I create a table by iterating through my student objects like this...
As you can see the table contains empty text boxes and I would like to validate these have been filled in, so in struts-config.xml I create my dynavalidatorform as follows...
And in validation.xml I place my validation rules...
Now here is where things start to go a bit pear-shaped
I have read somewhere online that I need to populate the form ArrayList before I get to my
jsp page. So I have created an action class called PreStudentsAction.java which takes the student ArrayList out of the session and assigns it to the student ArrayList in the form before forwarding to the students.jsp page...
Finally when I run my application my table is displayed but when I fill in the table and press submit I get the IndexOutOfBounds error. It appears to me that the student ArrayList in the form remains empty and that my Action class was unsuccessful in populating the form's ArrayList.
Can anybody see what I'm doing wrong?