HI Friends i will explain the scenario first i have a page, in that i need to display questions and options for that question. questions are dynamic, how many i have in database, i need to display all. and options for a question also dynamic , means one question may have 2 options and other can have 10 options.
How to say in struts-config.xml that a form-property contains another bean and how to solve this problem. Could any body explain me please?
Thanks & Regards<br />Mallik Avula<br />SCJP1.4
posted 7 years ago
The <form-property> element is only used if the bean type is DynaActionForm. Since you're not using DynaActionForm, this element is ignored.
I'd suggest simply defining a property in your ActionForm that is a List of QuestionBeans with corresponding getters and setters. If you plan on creating input fields for each question, you will also need an indexed getter for. Example:
You can then use indexed properties to access each question. For more information on how to use indexed properties, see question 7 of this forum's FAQ.