ncaramolegos
ncaramolegos

Reputation: 49

URLMapping to direct all request to a single controller/action

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

Upvotes: 0

Views: 197

Answers (1)

doelleri
doelleri

Reputation: 19702

In URLMappings.groovy,

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

will direct all URLs to FooController's bar action.

Upvotes: 1

Related Questions