jsf Validator bypass empty string
How to avoid jsf Validator bypass empty string? I am doing hibernate annotation validation. i found that if the textbox is empty it will not reach to javax.faces.validator phase.
How to avoid jsf Validator bypass empty string? I am doing hibernate annotation validation. i found that if the textbox is empty it will not reach to javax.faces.validator phase.
Because of special treatment by the HTTP-protocol empty values are not transmitted... if there is no value, then the value-change-events are not fired and therefor the validation will not be entered for this parameter...
That's why the "required"-attribute is somewhat different from the rest of the validators
How can i skip the require property and direct to validation phase. It is because the value can be null or if it is filled, the value just follow the format. How can i do that?
If I understand you correctly, you want an optional field with validation. Just add a validator to your component -- it will not be invoked if the value is null. Also the required attribute should be false of course.
I do not want the view to control the validation. Everything handled by annotation at backend. So how can i overwrite myfaces implementation of the require attribute?
Why do you want to override the implementation of required? In the use case you have outlined, you would not use the required attribute.
I do not want the front end decide the validation. I want all validation in annotation. So how to do that?