The construction of ActionForm's in Struts is typically left up to
ActionServlet (or FormTag) though. So using another constructor would only
make using it clunky. Rarely (and nowhere in my current massive Struts
application) does a user manually construct an ActionForm.
I wrote a BeanConverter that converts our value objects to Struts forms and
back. It is fairly sophisticated and does data type conversions because
most fields of our Struts form are String's. This would be similar to the
setData, which I think is a reasonable thing to have. The problem is that a
form bean does not have the same data types (typically) as a VO (or DO! :).
So a setData method would be of no use to my current application, at least.
Erik
----- Original Message -----
From: "Mathias Bogaert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 10, 2002 3:34 AM
Subject: RE: [Xdoclet-devel] [ xdoclet-Patches-529937 ] Add setData to
struts forms
> Constructing forms with the data object....the constructor allows the data
> object to be passed.
> The setter would be usefull if you would reuse the form, but struts does
> this internally already...
>
> Mathias
>
> -----Original Message-----
> From: Dmitri Colebatch [mailto:[EMAIL PROTECTED]]
> Sent: woensdag 10 april 2002 9:21
> To: Mathias Bogaert; [EMAIL PROTECTED]
> Subject: Re: [Xdoclet-devel] [ xdoclet-Patches-529937 ] Add setData to
> struts forms
>
>
> yes, but it also allows for pre-population of form data. I'm assuming
thats
> the motive... how else do you handle edit style
> screens?
>
> cheesr
> dim
>
> ----- Original Message -----
> From: "Mathias Bogaert" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 10, 2002 5:16 PM
> Subject: RE: [Xdoclet-devel] [ xdoclet-Patches-529937 ] Add setData to
> struts forms
>
>
> > Do note that adding the setter to the Struts form is dangerous. This
> allows
> > the developer to set data to the form, thinking he persists is, while in
> > fact, nothing is persisted.
> >
> > Mathias
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: woensdag 10 april 2002 9:04
> > To: [EMAIL PROTECTED]
> > Subject: [Xdoclet-devel] [ xdoclet-Patches-529937 ] Add setData to
> > struts forms
> >
> >
> > Patches item #529937, was opened at 2002-03-14 17:13
> > You can respond by visiting:
> >
>
http://sourceforge.net/tracker/?func=detail&atid=402706&aid=529937&group_id=
> > 31602
> >
> > Category: vendor
> > Group: None
> > >Status: Closed
> > Resolution: Fixed
> > Priority: 5
> > Submitted By: Matt (mpetteys)
> > Assigned to: Vincent Harcq (vharcq)
> > Summary: Add setData to struts forms
> >
> > Initial Comment:
> >
> > Here is a patch to add a setData method to struts
> > forms.. which comes in very handy.
> >
> > Index: struts_form.j
> > =======================================================
> > ============
> > RCS
> > file: /cvsroot/xdoclet/xdoclet/core/resources/xdoclet/e
> > jb/vendor/struts_form.j,v
> > retrieving revision 1.9
> > diff -r1.9 struts_form.j
> > 64a65,72
> > >
> > > public void setData
> > (<XDtEjbDataObj:dataObjectClass /> dataHolder)
> > > {
> > > <XDtStrutsForm:forAllFormFields>
> > > this.<XDtMethod:setterMethod/>
> > (dataHolder.<XDtMethod:getterMethod/>());
> > > </XDtStrutsForm:forAllFormFields>
> > > }
> > >
> >
> > *****CVS exited normally with code 1*****
> >
> >
> > ----------------------------------------------------------------------
> >
> > You can respond by visiting:
> >
>
http://sourceforge.net/tracker/?func=detail&atid=402706&aid=529937&group_id=
> > 31602
> >
> > _______________________________________________
> > Xdoclet-devel mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
> >
> > _______________________________________________
> > Xdoclet-devel mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
>
> _______________________________________________
> Xdoclet-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
>
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel