hfhc2
hfhc2

Reputation: 4391

Grails controller names and URL mappings

I am using grails 3 and I would like to know how the controller names are resolved. Apparently, if the UrlMappings.groovy contains

static mappings = {
    "/test"(controller: 'test', action: 'index')
}

Then a class TestController is needed. However, if I have a controller named TestValueController, then the mapping

static mappings = {
    "/test"(controller: 'testvalue', action: 'index')
}

does not work. How can I use a controller with a camel case name? More generally, for a controller named XController, which string should be used in the mappings section?

Upvotes: 1

Views: 577

Answers (1)

Burt Beckwith
Burt Beckwith

Reputation: 75671

That works fine, except that it's case-sensitive - testvalue should be testValue.

Upvotes: 2

Related Questions