You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Max Kremer <mk...@datastay.com> on 2002/12/29 00:13:48 UTC

Can you use the Validator with Map-Backed ActionForms?

I'm currently using Map-backed forms to manage forms that are dynamically
created from a database, where the number of fields, their names, their
types are not necessarily known at deployment (so no DynaActionForm). I'm
wondering if it's still possible to use the (Commons) Validator to validate
the form fields.

I understand that the normal usage requires form elements in the
validator-rules file to match that of a form-bean element in the Struts
config file. That's not really possible in my case because I don't know
ahead of time what the fields will be (by name or type, in number, etc.).
Would it be possible to programmatically create the formset and form
elements Validator requires but still use them in conjunction with the
validations file (where the validator elements are stored), which would be
commonly shared between forms? Any pointers on how I can accomplish this?
Or, is there a better way to handle dynamic (i.e., on-the-fly or real-time)
form creation with Struts?





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>