0
votes

I have controller named LoginController with action auth:

class LoginController {
   def auth = {
      render view: 'auth'
   }
}

So I go to the URL http://localhost:8080/myapp/login/auth, and want to see my view '/login/auth.gsp'. But I get the following error:

type Status report
message /myapp/WEB-INF/grails-app/views/jobSearch/auth.jsp
description The requested resource (/myapp/WEB-INF/grails-app/views/jobSearch/auth.jsp) is not available.

Seems that grails resolves wrong view name for some reason. Do you know, what's going on?

class UrlMappings { 
    static mappings = { 
        "/$controller/$action?/$id?"{ 
            constraints { // apply constraints here } 
        } 
        "/"(view:"/index") "500"(view:'/error') 
    } 
}
1
Have you tried running grails clean? Your code looks OK. - Antoine
No any changes in URLMappings Sometimes grails clean helps. sometimes not. - Maxim

1 Answers

0
votes

Agree with @omarello, something looks like its mapping the login controller URL to 'jobsearch'. The error message relating to JSP is what happens when it can't find a matching gsp page and tries to fallback to JSP.