views:

27

answers:

1

Hi,

For a simple class like,

class Person {

    String Name

    Double incomeFromWork = new Double(0.0)

    static constraints = {
        incomeFromWork(min:0d)
    }
}

However on the GSP page I get an "HTTP ERROR: 404" error when I enter alphabets for incomeFromWork value. What constraints should I use to accept a valid Double value as an income?

Thanks, BT

+2  A: 

Your constraints don't have any problems; they will correctly validate a Double property.

It's likely that your problem is in your controller. You're probably either redirecting to an undefined action or rendering a view that doesn't exist.

As an aside, you should probably rename Name to name to meet standard member naming conventions.

Rob Hruska