我正在使用grails 3,我想知道 Controller 名称是如何解析的。显然,如果UrlMappings.groovy
包含
static mappings = {
"/test"(controller: 'test', action: 'index')
}
然后需要一个
TestController
类。但是,如果我有一个名为TestValueController
的 Controller ,则映射static mappings = {
"/test"(controller: 'testvalue', action: 'index')
}
不起作用。如何使用带有 Camel 箱名称的 Controller ?更一般而言,对于名为XController的 Controller ,应在
mappings
节中使用哪个字符串?
最佳答案
可以正常工作,除了区分大小写-testvalue
应该是testValue
。
关于rest - Grails Controller 名称和URL映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39947529/