Great idea... make use of the nested property!

But what would the advantage be of using this "Map" as compared to the
request.getParameters()'s "Map"?

All I can see that it only would be useful if you did some validation in
your ActionForm on the "Map", any other uses?


Regards,
Daniel


-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] Behalf Of Martin Cooper
Sent: Thursday, 15 April, 2004 7:10 AM
To: [EMAIL PROTECTED]
Subject: Re: when not to use an ActionForm



I don't believe it can be done with the fields named like that, but there is
a trick you might be able to use. ;-)

1) In the <input> elements, use names of the form "dynaFields.field_1", etc.
The name isn't important, but the dot is.
2) Create a corresponding Map property in your form bean (i.e. a property
named "dynaFields" in this example).

When your action form is populated, you will end up with the "dynaFields"
map containing key/value pairs corresponding to the name/value pairs from
your <input> elements.

--
Martin Cooper


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to