...
Note |
---|
There is also an option for Client Side (Javascript and/or AJAX) based validation, please see Client Side Validation for more information. |
Examples
- Basic Validation
- Client Validation
- AJAX Validation
- Using Field Validators
- Using Non Field Validators
- Using Visitor Field Validator
...
Note | ||
---|---|---|
| ||
When using a Field Validator, Field Validator Syntax is ALWAYS preferable than using the Plain Validator Syntax as it facilitates grouping of field-validators according to fields. This is very handy especially if a field needs to have many field-validators which is almost always the case. Examples: validatortypes |
- required validator
- requiredstring validator
- int validator
- date validator
- expression validator
- fieldexpression validator
- email validator
- url validator
- visitor validator
- conversion validator
- stringlength validator
- regex validator
...
Wiki Markup |
---|
{snippet:id=javadoc|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
This list declares all the validators that comes with WebWork.
Wiki Markup |
---|
{snippet:id=validators-default|javadoc=false|lang=xml|url=https://xwork.dev.java.net/source/browse/*checkout*/xwork/src/java/com/opensymphony/xwork/validator/validators/default.xml?content-type=text%2Fplain} |
Note | ||
---|---|---|
| ||
|
Warning | ||
---|---|---|
| ||
|
Turning on Validation
Wiki Markup |
---|
{snippet:id=turningOnValidators|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=exTurnOnValidators|javadoc=true|lang=xml|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Note: The default validationWorkflowStack already includes this.
...
Wiki Markup |
---|
{snippet:id=fieldValidators|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=nonFieldValidators|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Notes
Wiki Markup |
---|
{snippet:id=validatorsNote|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Defining Validation Rules
Wiki Markup |
---|
{snippet:id=validationRules1|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=exValidationRules1|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=validationRules2|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=validationRules3|javadoc=true|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=exValidationRules3|javadoc=true|lang=xml|url=com.opensymphony.xwork.validator.ValidatorFactory} |
Wiki Markup |
---|
{snippet:id=validationRules|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Validator Flavour
Wiki Markup |
---|
{snippet:id=validatorFlavours|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Non-Field Validator Vs Field-Validator
Anchor | ||||
---|---|---|---|---|
|
Wiki Markup |
---|
{snippet:id=validatorVsFieldValidators1|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=nonFieldValidatorUsingValidatorSyntax|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=fieldValidatorUsingValidatorSyntax|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=validatorVsFieldValidators2|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=fieldValidatorUsingFieldValidatorSyntax|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=validatorVsFieldValidators3|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=similarVaidatorDeclaredInDiffSyntax|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Short-Curcuiting Validator
Wiki Markup |
---|
{snippet:id=shortCircuitingValidators1|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=exShortCircuitingValidators|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=shortCircuitingValidators2|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=scAndValidatorFlavours1|1=javadoc|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=exScAndValidatorFlavours|lang=xml|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
Wiki Markup |
---|
{snippet:id=scAndValidatorFlavours2|1=javadoc|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |
How Validators of an Action
...
are Found
Wiki Markup |
---|
{snippet:id=howXworkFindsValidatorForAction|javadoc=true|url=com.opensymphony.xwork.validator.Validator} |