within the page you just use normal input components - e.g.:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgboWTSwwY-RSnR3U8QfTQvhsN5wEsZcYBlpz9yxZ1kmMNdjBgE8WenjXzq4Rwt-WppWbVwShTucHjNpKYAeQ7EQkEshbZAZ5GO_EHnYf2H90GYlACV568BP-Ppw-x7DpynUy7UXdcfYMY/s400/01.png)
furthermore, you annotate e.g. your page bean with @FormValidator. the annotation also allows to specify a specific view-id, conditions as well as validation groups. to implement a more fine-grained multi-validation it's possible to provide multiple form-bean classes. to implement more complex combinations it's possible to use @FormValidator.List(...). (as alternative you can also us the provided java api to map your bean(s) to a form-validator. so if you don't like to use the annotation you can provide a separated mapping.)
usage of @FormValidator:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8b5t3rNZ9sl2X4fxvjtkM6xPS5JSgwgRJn7xh7NcFhcEb5s6vH8AWSt6DODu-LkPwh3ye-U_VcdA9VrzfJtZzrB_VVlhw8eaJT1snzul3RMnwcucqFa1dWvX8KzX30vJuYV0XD9mDLGk/s400/02.png)
in the page you see the id's of the different components. we have to use these id's as field-names (or setter-methods) in the form-validator.
the following figure shows a possible form-validator for this example:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuOpr_KjCp6Oel8abyGNYRy4Vx21Jo0nrlvesco43f4xb-m7P0j6pJnFCc7E9IPO1vFM2IoqB0FYPgu4o0sZa84nsyvsn41b3CvbteaQpY0aZyK3K40SMvQKNy9diBZUsqUrX-SiFBQZ8/s400/03.png)
as soon as the form-validator-bean is annotated with @Form, the validator is called by the bean-validation engine. so the violation message gets processed by the bean-validation engine and the final message is added as global faces-message.
(if you would like to use the current ConstraintValidatorContext of bean-validation, you can directly implement the FormBean interface instead of extending ViolationMessageAwareFormBean.)
if you use e.g. input components within a data-table, you can use 'add'-methods instead of the setter-method. in the form-validator you can use a data-structure like a list per column. as soon as the validation process starts (at the end of the validation phase) the form-validator contains all values (in case of input components in tables the validator is aware of all table values). so it's possible to implement any multi-field validation you can imagine (in case of input components in tables also validations per row as well as across rows).
additional features:
it's possible to map the form-bean-class to specific view-id's, to provide conditions as well as validation groups.