java - Struts Validation with multiple validation rules for a single field -


this might basic question: i'm trying understand how struts validation code below works:

<field property="myfield" depends="validwhen, maxlength">     <msg name="validwhen" key="error1.key" />     <msg name="maxlength" key="error2.key"/>     <var>         <var-name>test</var-name>         <var-value> isfieldsshown == "no" </var-value>     </var>     <var>         <var-name>maxlength</var-name>         <var-value>128</var-value>     </var> </field> 

is like, first validwhen rule checked , if succeeds maxlength rule checked? or, if validwhen returns true, field considered valid without going maxlength rule @ all?

it has been while since worked validator framework remember goes following.

when validate field, field considered valid if of validations pass. if @ least 1 validation fails field considered invalid.

it should make sense if there list of validators run, validation process should exit @ first fail (no sense in running costly validations if field marked invalid because validation failed).

the documentation seems indicate remember:

validator.dtd - field.depends attribute: the comma-delimited list of validators apply against field. field succeed, validators must succeed.

field.validate: run validations in depends clause on each item in turn, returning when first 1 fails.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -