Reputation: 1948
I have a weird error going on where when I start my Grails application and see the default home page, no matter what controller I click on I get a 404 not found. But if I change my URL mappings file to point a particular controller and method, then the associated view is rendered fine. I tried typing the url as 'controller/method' but that also gave the 404 and I know that the methods aren't being executed because my test log statements don't print. The only way my views are coming up is if I force them using the URL mappings file and then the test log statements in the methods will also print.
Upvotes: 0
Views: 253
Reputation: 27200
Make sure you have a URL mapping defined which supports the controller/action
pattern.
class UrlMappings {
static mappings = {
// you probably want a mapping like this...
"/$controller/$action?/$id?(.$format)?"{
}
// other mappings here
}
}
Upvotes: 1