You may lose *automatic* validation... remember that there is no technical
reason you have to use ActionForms at all, and if you do use them there is
nothing that says you have to associate them with Action Mappings.

For instance, I have seen some situations where developers didn't want the
auto-population to occur for one reason or another, and this is something
that cannot currently be disabled.  So, they wound up doing something like
this in their Actions:

MyActionForm af = new MyActionForm();
RequestUtils.populate(af, request);
ActionErrors errors = af.validate();
if (errors != null && !errors.isEmpty()) {
  request.setAttribute(Globals.ERROR_KEY, errors);
  return mapping.findForward("validationFailed");
}

You could do the same if you wanted multiple ActionForms per page... you
can instantiate as many as you want and deal with them manually like this.

The only "catch" is that the taglibs expect a single ActionForm per page
that is under a specific key in request.  There is nothing to stop you
from putting other ActionForms in request under different keys, but only
one can be The One True ActionForm per se, the rest you will have to deal
with manually.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Wed, August 10, 2005 3:28 am, Leo Asanov said:
>
> Michael, I don't think I really understand your
> suggestion. Don't I loose struts validation
> functionality if I don't have an ActionForm per html
> form?
>
> Cheers,
> Leo
>
>> ActionForm does not have to correlate to HTML form
>> one-to-one. You can
>> create one ActionForm with session scope and use
>> nested DTOs/BOs for
>> each HTML form. For relatives' form you can use a
>> list of nested DTOs.
>> It is even simpler that you do not need to render a
>> particular
>> relative, you just enter them.
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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

Reply via email to