'Bean validation' is a proper server-side validation which is one of a number of validations that you can use in JSF. JSF has long has its own validations in the view but since JSR-303, Bean validation, was introduced, that is supported as well and many validations could be removed from the 'view' to the model.
Bean-validation is not the same as and should not be confused with doing manual validation in managed beans when e.g. calling setters or action methods. The 'validation' phase of JSF has then already passed, so returning messages becomes more difficult.
Since not everyting can be (easily) done in JSF-303, there sometimes still needs to be additional validations in JSF specific ones.
PrimeFaces client-side validation should be seen as an addition to the server side validations, it does not replace them. It can use many of the existing JSF and JSR-303 validations and antomaticaly execute them client-side without any work from you. For more complex validations, custom client-side validations should be developed as you'd need to with client-side frameworks as well.
From the PrimeFaces documentation:
PrimeFaces Client Side Validation (CSV) Framework is the most complete
and advanced CSV solution for JavaServer Faces and Java EE. CSV
support for JSF is not an easy task, it is not simple as integrating a
3rd party javascript plugin as JSF has its own lifecycle, concepts
like conversion and then validation, partial processing, facesmessages
and many more. Real CSV for JSF should be compatible with server side
implementation, should do what JSF does, so that users do not
experience difference behaviors on client side and server side.
- Compatible with Server Side Implementation.
- Conversion and Validation happens at client side.
- Partial Process&Update support for Ajax.
- I18n support along with component specific messages.
- Client side Renderers for message components.
- Easy to write custom client converters and validators.
- Global or Component based enable/disable.
- Advanced Bean Validation Integration.
- Little footprint using HTML5.
So it is not a question of client-side OR server-side but whether you want/can use client-side validations to enhance user-experience so some of the (very few) downsides of JSF (round-trips for validations) is reduced.
validator
attribute) pumps up your bean, but simple use, or a custom validator for complex/secure validations and backend-access. In my opinion your question is a hard to answer best practices question. – ChristophS