Validwhen verifiers provided via Struts 1.2 can easily create more complex flexible form validation.
For example, we must verify that the user is the same, or when the user fills in the form "last name", the form "name" is required.
Validwhen needs to declare a VAR field called Test, the value of this variable is a Boolean expression, such as:
When a Boolean expression returns True, verification will succeed. Some elements are allowed to be sent to the expression:
Single quotes or double-colored string decimal, hexadecimal or octal representation of the shaped flats NULL indicates that the no-entered empty string can use any field name in the form, such as the Customerage explicitly referenced index field, such as ChildlastName [2] Implicit reference index field, such as ChildlastName [], indicating the same index word volume as this field * this * indicates the current authenticated form.
Example: The following code indicates that this field is valid only when the sendnewsletter field is empty, or when the field emailddress is not empty.
The following example is indicated that only the corresponding partnumber exists, the field Quantity is a must
This example below shows that if you enter a height of less than 60 inches, you can't do nbapointguard.