Skip to content

Tag: bean-validation

Fixed length Validation using Javax api

request response can be validated using javax annotation. However, need some help to have fixed length validation, as @Size(min=3, max=3). It is having message that ‘size must be between 3 and 3’. This is required to be changed. Answer If you want to change the default @Size message just declare p…

Validation issue with javax constraint

In a spring boot application, I have an entity where I put some annotation validation. Value for theses files I get many error Freq have one character, why i get this message? Empty value is lower then 17 for currency.. I don’t understand why this error occur. Answer The @Max annotation are validation f…

Spring Bean Validation @Valid handling

I have created a Spring MVC REST service using Bean Validation 1.2 with the following method: If object isn’t valid, Tomcat informs me that The request sent by the client was syntactically incorrect. and my validatedMethod is never called. How can I get the message that was defined in the ValidObject be…