Is there an easy generic way to include the field name into the error message for JPA validation?
@Pattern(regexp = "[a-z ]+", message = "The field: FIELD contains invalid characters: ${validatedValue}")
private String text;
some might say "just type the name of the field"... please if you dont know dont say, but dont suggest something that stupid... if it was only one field i would certainly do that... but is a system with hundreds of fields... some of them might change the names in the future... i would like to have a proper way to get the information...
it is possible to get the field value with ${validatedValue} so maybe there is a way to get the field name