i have a simple problme.
I need to catch when a user enter an empty string in a form and display the appropriate error message.
I’m trying with jsf required attribute, but if the user enter ” ” a string like that the validation go next without error.
I had try Spring annotation @NotNull and Hibernate @NotEmpty, but nothing solve the problem.
Any idea?
i have a simple problme. I need to catch when a user enter an
Share
I’m not sure about the Spring part, but in Hibernate you can use
@NotBlankannotation for this:Or, you could create a JSF converter for
String.classwhich does the job: