GrailsURLMapping 404
我有这个:GrailsURLMapping 404,grails,groovy,url-mapping,Grails,Groovy,Url Mapping,我有这个: static mappings = { "/a/b/$id/stuff"(controller: "stuff", action "action1" ) "/a/b/$id/stuff/$stuffId"(controller: "stuff", action "action2" ) "/a/b/$id/stuff/$stuffId/c"(controller: "stuff", action "action3" ) } 我可以点击action1和action2,
static mappings = {
"/a/b/$id/stuff"(controller: "stuff", action "action1" )
"/a/b/$id/stuff/$stuffId"(controller: "stuff", action "action2" )
"/a/b/$id/stuff/$stuffId/c"(controller: "stuff", action "action3" )
}
我可以点击action1
和action2
,但我不能点击action3
,因为它返回一个404
发生了什么事?您是否检查了视图的代码?我想如果它不能编译,你会得到404。 至少,这是我的经历
def method(){
}
这是行不通的
def method = {
}
将起作用。提示:使用codenarc grails插件。它有一个抓住这个错误的规则,加上许多其他有用的规则。