URLMapping to direct all request to a single controller/action

泄露秘密 提交于 2020-01-17 11:15:50

问题


I like to develop an API manager. I want, one single controller to accept all requests.

How can I direct all web requests to the same controller/action, where I should decide for farther processing.

I do not know how to configure the URLMappings.groovy. Possibly I could do that with filter but again I do not know.

I will appreciate your support.

Thanks


回答1:


In URLMappings.groovy,

static mappings = {
    "/**"(controller: "foo", action: "bar")
}

will direct all URLs to FooController's bar action.



来源:https://stackoverflow.com/questions/31595695/urlmapping-to-direct-all-request-to-a-single-controller-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!