0

In my grails 2.3.11 project, I want to show Please enter a positive numeric value for salaryon my screen if the negative value is inputted. But it displayed Property [salary] with value [-9] is less than minimum value [0]

Constraints in my domain class

BigDecimal salary
static constraints = {
    salary nullable: false, min:0 as BigDecimal, scale: 2
}

Messages.properties

default.invalid.min.message=Property [{0}] with value [{2}] is less than minimum value [{3}]

employee.salary.invalid.min.message=Please enter a positive value for salary

I think the second line in the messages.properties is wrong, help me please!

Stephen Tun Aung
  • 982
  • 9
  • 18

1 Answers1

1

To override the message, you would need

employee.salary.min.notmet=Please enter a positive value for salary
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139