You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2001/09/28 05:08:09 UTC

Re: Questions about ActionForm

Viral Tolat wrote:
> - When should an ActionForm actually load values from the business
> objects?  On setServlet or reset?

In Action.perform()

> - Where would I add a hook into the Struts framework that would allow an
> ActionForm to be notified before any values are populated on it?
> Would this be in reset() or in ActionServlet.processPopulate()

Either would work. 

But neither is guaranteed to populate all the values of a form.

 
> Thanks.

Please post any additional questions like this on the user list.

Ted

Re: Questions about ActionForm

Posted by Viral Tolat <vi...@integral.com>.
Thanks.  The issue we're dealing with is that our JavaBeans are transactional
and we need to start a transaction before any values are loaded into them from
the page, via the ActionForm.  So, after the ActionServlet is called and
before it populates the ActionForm, we need to start a transaction. We don't
want to stage values in the ActionForm and then copy them to the transactional
beans since this would be significantly more development work.  We are
considering using XML as an intermediate stage, however, we'd need Struts to
be updated to handle an XML DOM and allows properties to navigate an XML
document.

Also, a couple of followup questions:

- For certain actions we don't want to process the form data at all. Is there
anyway to to test for these actions before the ActionForm is populated?  This
is partly a performance consideration especially if the user cancels or aborts
editing of a a large form.

- We have nested JavaBeans under the ActionForm.  Is there any way to control
the setting of form properties so that shallow properties are set before
deeper properties, e.g., we want X.Y set before X.Y.Z.   This is especially
important in cases like X.Y[3].Z, where Y[3] may not exist yet and needs to be
created before Z can be set.

Thanks,
Viral



Ted Husted wrote:

> Viral Tolat wrote:
> > - When should an ActionForm actually load values from the business
> > objects?  On setServlet or reset?
>
> In Action.perform()
>
> > - Where would I add a hook into the Struts framework that would allow an
> > ActionForm to be notified before any values are populated on it?
> > Would this be in reset() or in ActionServlet.processPopulate()
>
> Either would work.
>
> But neither is guaranteed to populate all the values of a form.
>
>
> > Thanks.
>
> Please post any additional questions like this on the user list.
>
> Ted