What I was thinking of doing, is to prefix the components at the JSP such
that I can pick them up at action classes by iterating. Suppose I've 5
textfields that makes up a Person object, and the user dynamically adds 5
Persons at the JSP and submits, what I would do at my action class is to
loop through, and create a Person object through each set of 5 textfields.

What do you think of my approach? Or there's a better or more elegant way of
doing things?

Thanks!

On Wed, Mar 5, 2008 at 1:58 AM, Dave Newton <[EMAIL PROTECTED]> wrote:

> --- Cheng Wei Lee <[EMAIL PROTECTED]> wrote:
> > Suppose I use JavaScript to allow user to dynamically adds the number of
> > textboxes in the form, then submit. Would implementing RequestAware
> help?
> > Do I have to create the variables and getters/setters in advance at the
> > action class?
>
> You may also use array notation in situations like this, particularly when
> it's a collection of identical types, like Strings, or a "Person" object,
> etc. It can save a lot of boring code.
>
> Dave
>
> > On Wed, Mar 5, 2008 at 1:15 AM, Ian Roughley <[EMAIL PROTECTED]> wrote:
> > > If you implement the RequestAware interface, the map will contain all
> > > the form values.
> > >
> > > Cheng Wei Lee wrote:
> > > > In Struts 1, we could use map-backed form beans to deal with dynamic
> > > forms, is there something equal in Struts 2?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to