I have some questions about Bean Validation and JSF validation, currently I am using Bean validation:
- With the JSF validation, the validation works client side only, no request sent to server, and Bean validation works on server?
- If javascript is disabled are both will work JSF & Bean Validation, or only bean validation?
- What are the disadvantages of Bean validation if there are any?
That is not true. The validations are applied during the jsf life cycle by
Process Validations.You can also find this information in the specification.
Both work without
javascript.This is more a question of programming style. I think validation is better made in the model than in the view, because it removes logic from the view and it is more DRY (don’t repeat yourself). If you use a bean multiple time, you will have to write the validation only once with bean validation. You should also know that bean validation overwrite constraints in JSF.
More information how to use bean validation, you can find here and the specification here.
For more information about the integrated JSF validation, you should visit this site.