I'm stuck and could use a little guidance.
I'm trying to add a survey page to an existing site. I'm attempting to drive the entire page from the database. I have tables for questions and for valid choices (all questions are multiple choice and the choices will be presented in drop-downs next to the associated questions).
I have DTOs for the tables. In addition, I've defined a QuestionAndAnswerBean that contains the following:
validChoiceList (an ArrayList of ValidChoiceDTOs)
selectedAnswer (an int)
The QuestionDTO exposes, among other things, a propererty called question which contains the question text.
The ValidChoiceDTO exposes, among other things, properties validValueText and validValueID.
So there will be one QuestionAndAnswerBean for each question on the page that contains one question and a list of the choice DTOs ; I load these beans into an ArrayList and expose this List in the FormBean.
On the page, I have the following:
<logic:iterate name="surveyForm" property="qsAndAs" id="surveyQuestions" indexId="qaIdx">
<bean:write name="surveyQuestions" property="questionDTO.question" ignore="true"/>
<html:select name="surveyQuestions" property="selectedAnswer">
<html:options name="surveyQuestions" collection="validChoiceList" labelProperty="validValueText" property="validValueID" />
If I get rid of the table row with the drop-downs, the page renders and all the questions are there. If I include that table row, the page does not render. Furthermore, the Tomcat logs contain multiple error messages to the effect of:
Cannot find bean under name validValueID
Obviously I am misunderstanding something here, but nothing I've tried has worked. I've logged the data in the objects in the Action just before I expose it to the form bean; it's populated correctly.
Any help would be very much appreciated.