Reputation: 2502
I have a grails 2.3.8 app.
It has a view: views/rte/subscriptions.gsp
I have a controller: controllers/RTEController.groovy
RTEController contains an action:
def subscriptions() {
}
UrlMappings.groovy contains:
"/rte" (controller: "rte") {
action = [GET: "subscriptions"]
}
When I browse to:
http://localhost:8080/MYAPP/rte
I get a 404 error.
Why is the url mapping not working?
Upvotes: 0
Views: 378
Reputation: 50245
Since CamelCase format is not used for controller name. The mapping has to match with the exact name of the controller. Modify the url mapping as below:
"/rte" (controller: "RTE") { //controller name all CAPS
action = [GET: "subscriptions"]
}
Also note, this is applicable during dependency injection as well. For example, if there is a service named RTEService
, then it can only be injected in other classes as
def RTEService //instead of def rteService or def rTEService
Upvotes: 3