I would like to make sure that totalAmount
is greater then 0.
I have following code to in my Java bean:
@NotNull(message = "Total amount must be entered")
@Digits(integer = 8, fraction = 2, message = "Please enter a valid amount less than 99,999,999.99")
@DecimalMin(value = "0.01", message = "Please enter a valid amount more than 0")
private BigDecimal totalAmount;
Unfortunately valdr-bean-validator
(tool to use JSR-303 with AngularJS) doesn't support @DecimalMin
or @DecimalMax
. Is there any other way to create the rule for values greater then zero?
EDIT: please note that totalAmount
is BigDecimal