问题
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