dcsimg
Collections of Objects within an ActionForm
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bishma_Stornelli
Posted On:   Friday, January 20, 2012 04:43 PM

Hello. I'll explain my problem in few words. I need to create a form to make a test from the admin interface. There's only one test. Users must to take the test and all their answers must to be save in the DB. Questions in the test are all dropdown. They have a description and a set of options. Options have a value and a description. The value of each option is unique within all values (autoincrement id in the database). To save the answer I have to make the bean for the form, so it would be something like a class with UserId and AnswerSet My classes would look something like this: public class Question extends ActionForm{ private String description;    More>>

Hello. I'll explain my problem in few words.



I need to create a form to make a test from the admin interface. There's only one test. Users must to take the test and all their answers must to be save in the DB.



Questions in the test are all dropdown. They have a description and a set of options. Options have a value and a description. The value of each option is unique within all values (autoincrement id in the database). To save the answer I have to make the bean for the form, so it would be something like a class with UserId and AnswerSet



My classes would look something like this:



public class Question extends ActionForm{

private String description;

private List options;

}



public class Option extends ActionForm{

private int value;

private String description;

}



public class UserTest extends ActionForm{

private int UserId;

private List answers;

}



I know how to make the form to the make the test from the user interface. What I don't know is how to make the jsp page to display the needed form and how to get the information in the Action so I can save the users' answers in the model.



It's very importan for me to make this so if you need additional information to answer this topic please ask me and I'll answer as fast as I can.

   <<Less
About | Sitemap | Contact