采取使用GrailsGrails的URL映射优先级规则
'/api/abcdef' (resources: 'abcDef')
'/api/abc' (resources: 'abc')
以下URL映射到/api/abcdef
调用调用AbcController.index()
与def
一个format
参数,而不是AbcDefController
。但是,致电/api/abcdef/1
正确解析为AbcDefController.show()
。这看起来像作为grails url-mapping-report
错误将报告
| GET | /api/abcdef | Action: index |
去AbcDefController
下。
但是,如果改变这两个网址来
'/api/abc' (resources: 'abc')
'/api/abcdef' (resources: 'abcDef')
Grails的顺序将正确解析/api/abcdef
到AbcDefController.index()
。
但在这两种情况下/api/abc123
将解析为AbcController.index()
与format
参数123
什么是URL映射的优先级机制?上述行为是否正确?我使用Groovy 2.4.5和Grails 2.5.3。
你找到这个问题的答案?如果是这样,如果你可以在这里发布,我很乐意。谢谢。 – 10GritSandpaper