When I use the same code with @Lenght validation all is working fine. Am I right that it's caused by the problem described in documentation:
Note: specifying @NotNull on the model does not eliminate the requirement for required="true" to appear on the control! This is due to a limitation of the JSF validation architecture.?
If so is there any way to customize validation error message for required=true constraing?
This is a very common JSF problem. required=true must be specified because JSF will not kick off any validation for empty fields. This means that you are limited to the REQUIRED message unless you do your own custom handling. The approach I've used in the past can be found at:
Under "Add Field Reference Information to a Message." I've also seen slightly different takes on this approach in a number of blogs. Hope that helps.
Thank you very much for the reply!