User.grrovy
package com
class User {
String name
static constraints = {
name blank:false
}
}
Usercontroller.groovy
package com
class UserController {
def index() {
redirect(action:sup)
}
def sup(){
def person=[name:'sai']
def user=new User(person)
assert s.name=='sai'
}
}
当我运行此任务时,它会显示:
错误500:内部服务器错误
URI:/ practice / user / indexClass:groovy.lang.MissingPropertyExceptionMessage:没有这样的属性:sup for class:com.moog.UserController
答案 0 :(得分:1)
你应该:
redirect(action:'sup')