Wendy:

I too am reviewing DynaActionForms.  Do you know if it's possible to use
beans and collections for the properties? If so, how would I define these
fields in the JSP?

Vinh

For exmaple,
    <form-bean name="logonForm"
type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="username" type="java.lang.String"/>
      <form-property name="password" type="java.lang.String"/>
        <form-property name="mybean" type="com.foo.bar.MyBean"/>
        <form-property name="mycoll" type="java.util.Map"/>
    </form-bean>

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 1:14 PM
To: 'Struts Users Mailing List'
Subject: RE: Question about struts-example struts-config.xml


Craig wrote:
> For this specific case, there is no reason to have a LogonForm class at
> all, because the default behavior of a DynaValidatorForm (which is a
> DynaActionForm plus using the validator framework to define validation
> rules) does everything you need.

Wow... I just deleted the LogonForm.class file under the 'classes' directory
and reloaded the app... and everything still worked.  Then I added a field
to the form in struts-config.xml, and to logon.jsp, reloaded again, and my
new field magically appeared.  NOW I see how it works!

> The only reason you would ever need to create a real class that extends
> DynaActionForm or DynaValidatorForm would be if you need a custom reset()
> or validate() method.

Confused again.  (I will need a custom validate method.)  How does Struts
know to start with my class that extends DynaWhateverForm and add the stuff
in the <form-bean> tag to it, rather than creating a new one?  Would it be:
    <form-bean      name="logonForm"
                    type="edu.asu.vpia.blah.blah.LogonForm">

and then
  package edu.asu.vpia.blah.blah;
  public final class LogonForm extends DynaValidatorForm { ... }

??

Thanks for helping me through this part!

--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


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

Reply via email to