Limitations message in play20 validator

I would like to have another Constraints validation message, but I'm wandering around how to do this .... Example

@Constraints.Required @Constraints.Pattern("\\d{1,6}") public String thisIsAnInt; 

I would like something

 @Constraints.Required @Constraints.Pattern(message="ThisismyspecificMessage",value=\\d{1,6}") public String thisIsAnInt; 

To display it correctly using bootstrap in the form.

Maybe? many thanks

+4
source share
1 answer

As you wrote, you can use

 @Constraints.Required(message = "This is field required") @Constraints.Pattern(value = "\\d{1,6}", message = "This field must contain from 1 to 6 digits") public String thisIsAnInt; 
+10
source

Source: https://habr.com/ru/post/1402934/


All Articles