Grails 1.3.7选择错误的控制器视图

时间:2011-12-02 08:54:34

标签: grails views

我有一个名为LoginController的控制器,其操作为auth:

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

所以我转到网址http://localhost:8080/myapp/login/auth,想要查看我的视图'/login/auth.gsp'。但是我收到以下错误:

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.

似乎grails因某种原因解析了错误的视图名称。你知道吗,发生了什么事?

class UrlMappings { 
    static mappings = { 
        "/$controller/$action?/$id?"{ 
            constraints { // apply constraints here } 
        } 
        "/"(view:"/index") "500"(view:'/error') 
    } 
}

1 个答案:

答案 0 :(得分:0)

同意@omarello,看起来它将登录控制器URL映射到'jobsearch'。与JSP相关的错误消息是当它找不到匹配的gsp页面并尝试回退到JSP时会发生的事情。

相关问题