struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From R Balaji <>
Subject Validator Problem when using "Required"
Date Thu, 24 Jul 2003 05:50:09 GMT

I am using Struts Validator for validating my Application. i am using 
"required"  for many of the fields and using minlength and maxlength for 
the userName field.

my validation.xml reads like this,

/Ex :

  <field  property="lastName" depends="*required*">
      <arg0 key="validateform.lastname"/>

  <field  property="userName"
      <arg0 key="validateform.userName" name="required"/>
 <arg0 key="validateform.userName" name="minlength"/>
<arg1   key="${var:minlength}" name="minlength" resource="false"/>

 <arg0 key="validateform.userName" name="maxlength"/>
<arg1   key="${var:maxlength}" name="maxlength" resource="false"/>

  <field  property="age"
      <arg0 key="validateform.age"/>

If i fail to give the userName it is prompting, that userName is 
required. But if i input only "2" characters for the userName, while all 
other ( some of the other ) fields are empty it prompts only about all 
other required fields, and not validating the *minlength* condition 
until all other required conditions get satisfied. I feel it should also 
validate the userName and prompt that the length is less than 5 chatacters.

is there anything to define the precedence in the validation.xml ? .. 
will the minlength be validated only if all the required get satisfied. ??

please Help me.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message