问题
I have upgraded from Grails 1.3.7 to 2.0.0.RC1:
After sorting out a lot of issues with depdendencies I have finally managed to start my Grails application but when browsing to URL it tell me I receive the following:
GroovyPagesServlet: "/index.gsp" not found
It worked perfectly before... where is it looking for it?
Thanks
Jonas
回答1:
ok, I figured it out. The above syntax in UrlMappings.groovy
does not work. It must be:
"/" {
controller = "user"
action = "login"
}
回答2:
As I add SecurityFilters.groovy due to official docs, the same thing happens. Tomcat show error: "/index.gsp" not found Please see also: http://grails.org/doc/latest/guide/theWebLayer.html#filterTypes
class SecurityFilters {
def filters = {
loginCheck(controller: '*', action: '*') {
before = {
if (!session.user && !actionName.equals('login')) {
redirect(action: 'login')
return false
}
}
}
}
}
Actually, I think the official doc make a mistake. After
redirect(action: 'login')
it should be
return true
回答3:
Edit UrlMappings.groovy
, add this,eg:
/errorInfo.gsp
(view: /errorInfo
)
ref from : http://grails.1312388.n4.nabble.com/Direct-linking-to-gsp-in-Grails-2-0-td4228929.html
来源:https://stackoverflow.com/questions/8089592/upgrade-to-grails-2-0-index-gsp-not-found