Grails 2.2无法识别主页视图

时间:2013-11-13 16:55:00

标签: grails upgrade gsp

我正在将grails 1.3.6 app升级到2.2.4。在1.3.6中,通过点击localhost:8080/APPNAME来访问该应用。然后,这将在grails-app/views/index.gsp中呈现文件。

将应用升级到2.2.4后,点击localhost:8080/APPNAME'会返回错误:

HTTP Status 404 - "/index.gsp" not found.

我的URLMappings文件如下:

class UrlMappings 
{

static mappings = 
{
    "/$controller/$action?/$id?"{
        constraints {
            // apply constraints here
        }
    }

    "/"(view:"/index")
    //"500"(view:'/error')
    "500"(controller: 'pacErrors', action: 'handleErrors')
}
}

我可以通过URL调用直接访问控制器,因此服务器似乎已启动并正在运行。

1 个答案:

答案 0 :(得分:0)

这一切似乎都是正确的,有时在升级后遇到奇怪的行为时,我发现最好的解决方案是“grails clean”,并确保通过运行“grails upgrade”将应用程序确实迁移到2.2.4。

如果这不起作用,请尝试使用grails 2.2.4直接创建一个新应用程序来测试它。如果之后您无法发现问题,可以将现有应用程序复制到新应用程序中。