URLMapping to direct all request to a single contr

2019-09-08 14:47发布

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条回答
唯我独甜
2楼-- · 2019-09-08 15:49

In URLMappings.groovy,

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

will direct all URLs to FooController's bar action.

查看更多
登录 后发表回答