validation - JSR 303 - Validate a field if it is not null -
i have form filled in, , of fields options. want apply validations on information filled in optional fields should validated if there filled in, if theses not null. did of similar ? or have suggestion?
thanks.
bean validation constraints accept null
valid value (with exception of @notnull
of course). depending on ui framework might retrieve empty strings instead of null fields without user input. if you're working jsf 2, can set context parameter javax.faces.validate_empty_fields
false
avoid validation of empty fields.
Comments
Post a Comment