Validating double and float values using Hibernate Validator - bean validation

前端 未结 6 1456
心在旅途
心在旅途 2020-12-29 11:16

I\'m looking for a way to validate a java.lang.Double field in the Spring command bean for its maximum and minimum values (a value must lie between a given rang

6条回答
  •  梦谈多话
    2020-12-29 11:29

    If you have switched to BigDecimal (or BigInteger), you could use @DecimalMin or @DecimalMax. But this is still no solution for float or double.

提交回复
热议问题