On Tue, 11 Mar 2003 17:36:09 +0100
Heligon Sandra <[EMAIL PROTECTED]> wrote:

> Has someone an example of struts-config.xml file and
> a such SetUpAction with DynaActionForm and Collection ?

In a form-bean declarations, where YourDyanForm is a subclass of a
DynaActionForm(DynaValidatorForm):

<form-bean name="projectForm"
dynamic="true" type="foo.bar.YourDyanForm">

 { snip }
<form-property name="myCollection" type="java.util.ArrayList"/>        
 { snip }
</form-bean>


Then in you Action class...


execute(..) {
        ArrayList someList = someBusinessClass.getMeListOfObjectsIneed();
        formBean.set("myCollection" someList );

        //forward to jsp page
}


The reason you'll want to subclass DynaActionForm is if you do some
validation you probably will have to override the reset method.  

-- 
Rick Reumann

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

Reply via email to