Answer the question
In order to leave comments, you need to log in
Problem with validation, how to view annotation messages in case of bean validation?
Question about the messages that are written in the annotations.
When initializing a variable with an empty string, as in my case, should I get a message output to the console? Where should I see the output of this message? What is missing in this code so that I can get the output of messages during validation?
@NotBlank (message = "First name can't be an empty field")
@NotNull(message = "First name can't be an empty field")
private static String name;
public static void main(String[] args) {
init("");
}
public static void init(String value){
name = value;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question