Craig,

Thanks for the quick reply.  Most of my forms do have some sort of a custom
validation requirement - hence my confusion about the advantage(s) of
DynaActionForms over ActionForms.

Thanks again!

jerry

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 1:10 PM
To: Struts Users Mailing List
Subject: Re: DynaActionForm Advantages




On Mon, 8 Jul 2002, Jerry Jalenak wrote:

> Date: Mon, 8 Jul 2002 13:03:48 -0500
> From: Jerry Jalenak <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: DynaActionForm Advantages
>
> All,
>
> What are the advantages to using DynaActionForms over the traditional
Struts
> ActionForms?  I'm in the process of looking at some of the newer features
of
> Struts 1.1, and frankly, I don't see where DynaActionForms is going to do
> much for me.  In fact, in my limited view of the universe, it looks like
> DynaActionForms are a move back toward a standard servlet, one where you
> access HTML form data through a 'request.getParameter("form-variable")'.
> Also, it would appear that the use of DynaActionForms forces all of the
form
> validation into the Action, making the Action more complex than it needs
to
> be (compared to the 'validate' method of the ActionForm).
>
> What am I missing?  There must be some advantage to the use of
> DynaActionForms....
>

The benefit of using DynaActionForm instead is in one of the following two
use cases:

* If your ActionForm bean doesn't have a custom reset() or validate()
  method, you don't need to write your own form bean class at all --
  simply configure the properties in struts-config.xml.

* If your ActionForm bean does have a custom reset() or validate() method,
  those are the only ones you have to write -- no more time wasted with
  all the property getter and setter methods (have you ever done anything
more
  boring that writing those?).  Simply subclass DynaActionForm and
  implement the validate() method in the usual way (although it will
  have to use get() to get the values to be tested, instead of the
  usual property getter methods).

Given how many situations are covered by one or the other of the above,
I'd say DynaActionForm is modestly useful :-).  But, like most things,
it's just an option.

Craig


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


This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at (800)388-4675.



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

Reply via email to