Is FormBean supports indexed properties? Where can I find this?

-----Original Message-----
From: Aur Gal [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 1:49 PM
To: '[EMAIL PROTECTED]'
Subject: RE: How to create bean from dynamic JSP page


why not use a List (ArrayList) to store the questions?

the getter and setter methods could be told which cells to set and
return
from this list.

-----Original Message-----
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 12:41 PM
To: '[EMAIL PROTECTED]'
Subject: RE: How to create bean from dynamic JSP page


Here is my situation:

I have questionnaire where the number of questions depends on user type.
Each question has multiple choices presented to user as radio buttons. 

I have collection of questions and I am going to use Iterator tag to
display them. However, I need QuestionsForm which will have n ( where n
is number of questions) Strings that will correspond to each question. 

Struts is using reflection to match each element's name to QuestionsForm
instance variable. I don't know how to build this QuestionsForm with
variable # of instance variable. I can assume the max number of
questions but this doesn't look clean to me.

Thanks, Mark.

-----Original Message-----
From: Basile Andrea [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 12:10 PM
To: '[EMAIL PROTECTED]'
Subject: RE: How to create bean from dynamic JSP page


I don't know what is your applications's architecture, but I think the
Iterate tag could accomplish this. You could set a Collection of
questions
in the Action Form and let it pick them up in the JSP.
If you have something like a bean "Question" with some properties set,
this
could be very easy to do.

Andrea

-----Original Message-----
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: mercoledì 25 ottobre 2000 17.21
To: [EMAIL PROTECTED]
Subject: How to create bean from dynamic JSP page


Hello,

We are trying to migrate existing application from JSP/Servlets to
struts. I have a JSP page which should display dynamically different
questions. I don't know how to create a form bean with all
setters/getters since I don't know in advance all the names. Anyone
knows how to accomplish this?

Thanks, Mark.

Reply via email to