A More Complex JSF/Ajax Interaction
The form completion example was mostly JavaScript and very little JSF.
Here we describe an application that performs
Realtime Validation.
- When the fifth character of the zip code field is entered, an
Ajax Post request is sent
- That request triggers the
JSF life cycle
so that the component tree (view state) can be accessed after the
Restore View phase
- A phase listener is implemented to invoke a zip code
validator
- If the validator throws an exception, it is caught, an error is written
to the response, and the request is terminated