Hi,

you have in struts-conf a formBean:

<form-bean name="form1"
type="org.apache.struts.validator.DynaValidatorForm">
  <form-property name="property1" type"java.lang.String"/>
</form-bean>

this action-config:
<action path="/foo" name="form1" validate="true" .../>


in validation.xml:
   <formset>
     <form name="form1">
         <field
     property="property1"
     depends="required">
       <arg0 key="i18n.property1"/>
           </field>
...
        </form>
        ....
</formset>






-----Ursprüngliche Nachricht-----
Von: Caroline Jen [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 23. Dezember 2003 08:39
An: [EMAIL PROTECTED]
Betreff: Validation


One simple question - if my form bean is of the DynaValidatorForm type
in the struts-config.xml and each propery of the form is specified in
the validation.xml, do I have to call the validate method in the form
bean?  E.g. Do I still have to do the following in my form bean that
extends the ActionForm?

public ActionErrors validate( ActionMapping mapping, HttpServletRequest
request ) 
{
   ActionErrors errors = new ActionErrors();
   if ( getSender() == null || getSender().length() <
1 ) 
   {
      errors.add( "sender",new ActionError( "error.sender.required" ) );
   }

   ........
   ........

}


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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


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

Reply via email to