我有一个带有常用字段(名称、密码等)的用户域对象
grails生成所有用户
def create() {
respond new User(params)
}
当我运行应用程序并单击“创建用户”按钮时,我收到以下错误:
Error 500: Internal Server Error
URI
/user/create
Class
groovy.lang.MissingPropertyException
Message
null
Caused by
No such property: controller for class: gi.dam.desk.core.User
Around line 23 of grails-app/controllers/gi/dam/desk/admin/UserController.groovy
20: }
21:
22: def create() {
23: respond new User(params)
24: }
如果我调试应用程序,并查看“params”的内容,则:
controller: user
format: null
action: create
这似乎很奇怪,这将传递到创建一个域对象。不管怎样,它都失败了。
如果我马上更改代码:
def create() {
respond new User()
}