Java Reference
In-Depth Information
Previous validation errors?
yes
when=ValidationState ?
no
ALWAYS
call methods
annotated with
@ValidationMethod
NO_ERRORS
errors
ValidationErrorHandler {
Resolution handleValidationErrors(
ValidationErrors errors);
no errors
}
errors
no errors
use returned Resolution
or getSourcePage()
Execute
event handler
Figure 4.9: Custom validation methods
For example, we might be adding a record in a database and we won't
know whether there is a duplication error until the operation returns
or throws an exception:
try {
database.add(record);
// all is well
}
catch (DuplicateRecordException) {
// validation error: duplicate record
}
 
 
 
Search WWH ::




Custom Search