【发布时间】:2020-05-26 09:49:40
【问题描述】:
我将我的 url 映射组织在带有组的 grails 中。
来自 UrlMappings 的示例:
class UrlMappings {
static mappings = {
group "/rest", {
"/" {
controller = "rest"
action = "index"
}
"/method1" {
controller = "rest"
action = "method1"
}
}
"/webservice/" {
controller = "webservice"
action = "index"
}
}
我想要什么:当 URL 被称为 /rest/notexists 时,我想要这个路径的 404。但仅适用于 /rest 组,因此 404 应该属于组 rest。其他 404 由我的骨干路由器处理。
有什么想法吗?
【问题讨论】:
-
您应该能够定义嵌套在
group '/rest'内的“404( ... )”映射
标签: grails