Hi, I think i'm having a similar problem with struts validation in that 
there seems to be a two stage validation process. All 'required' fields 
seem to be validated first and only once they are resolved then the min 
and max length validation is processed.

My validation.xml is as follows;

<form-validation>
   <formset>
 
      <form name="ExampleValidatorForm">
         <field property="textField1" depends="required">
          <arg0 key="textField1.label"/>
         </field>
 
         <field property="textField2" depends="minlength">
          <arg0 key="textField2.label"/>
          <arg1 key="${var:minlength}" name="minlength" />
          <var>
            <var-name>minlength</var-name>
            <var-value>5</var-value>
          </var>
         </field>
 
             <field property="textField3" depends="maxlength">
                  <arg0 key="textField3.label"/>
                  <arg1 key="${var:maxlength}" name="maxlength" />
                <var>
                  <var-name>maxlength</var-name>
                  <var-value>10</var-value>
                </var> 
             </field>
 
      </form>

   </formset>
</form-validation>

Is this the way struts validation works or am I missing something?

Will Durrant
Software Engineer
Digital Steps Limited 

Reply via email to