I just did this.  I based my solution on the Dynamic Properties solution by
Kevin Wang
(http://www.mail-archive.com/struts-user@jakarta.apache.org/msg01374.html),
but I needed to do it without modifying/extending Struts itself.

I created a BaseActionForm that my ActionForms extend.  The Base class has a
method that takes the HTTP request, and for each parameter in the request
that doesn't have a setter method in the form (determined via reflection),
it adds it to a hashtable.  It also provides methods to retrieve the
hashtable or one named dynamic property.

Then, my Action classes first call form.setDynamicMethods(request), and then
they can retrieve the parameters from the known getter methods or from
getDynamicProperty() or getDynamicProperties().

There's a slight performance penalty in that the request parameters are
traversed twice (once by Struts and once by me), but it's important to me
(and my customers ;-)to be able to upgrade Struts without re-integrating my
customizations.

Michael


> Hi 
> I have a view(a jsp) which gets its Input fields Dynamically. 
> The number of input field is not constant.
> how can I create Action form in this scenerio.
> 
> Thanks
> Amit
> 


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

Reply via email to